<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>通道管理</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="{{asset('/layuiadmin/layui/css/layui.css')}}" media="all">
<link rel="stylesheet" href="{{asset('/layuiadmin/style/admin.css')}}" media="all">
<style>
    .edit{background-color: #ed9c3a;}
    .floweredit{background-color: #ed9c3a;}
    .shua{background-color: #ed9c3a;}
    .sao{background-color: #ed9c3a;}
    .shenhe{background-color: #429488;}
    .see{background-color: #7cb717;}
    .tongbu{background-color: #4c9ef8;color:#fff;}
    .cur{color:#009688;}
    .way{height:38px;line-height: 38px;}
    .open{}
    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    }
    input[type="number"]{
    -moz-appearance: textfield;
    }
    .f_inputs{
    width:80%;
      display: inline-block;
      margin-right: 10px;
    }
    .f_block{
    margin-left:0;
    width:300px;
    float:left;
    }
    .delpassway {
    background-color: #e85052;
    }
    .wx_list{
    display: none;
    }
    .lianfushow{
        display: none;
    }
    .nongjinkey{
        display: none;
    }
    .zhongduanid{
        display: none;
    }
    .returnSettings{
      /*display: none;*/
      display: block;
      width: 80px;
      height: 40px;
      line-height: 40px;
      margin-left: 35px;
    }
    .checkbox{
      width: 10px;height: 10px;
    }
    .xgrate{
        color: #fff;
        font-size: 15px;
        padding: 7px;
        height: 30px;
        line-height: 30px;
        /* border: 1px solid #666; */
        background-color: #3475c3;
    }
</style>
</head>
<body>

    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-fluid">
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md12">
                            <div class="layui-card" style="margin-top:0px">
                                <div class="layui-card-header">通道管理列表</div>
                                <div class="layui-card-body">
                                    <div class="layui-btn-container" style="font-size:14px;">
                                        <table class="layui-hide" id="test-table-page" lay-filter="test-table-page"></table>

                                        <!-- 判断状态 -->
                                        <script type="text/html" id="rate">
                                        @{{ d.rate }}%
                                        </script>
                                        <!-- 判断状态 -->

                                        <script type="text/html" id="table-content-list" class="layui-btn-small" id="passway">
                                             @{{#  if(d.ways_type == 8005 || d.ways_type == 6005){ }}
                                                <a class="layui-btn layui-btn-danger layui-btn-xs shua" lay-event="shua">修改费率</a>
                                            @{{#  } else if(d.ways_type == 8004 || d.ways_type == 6004){ }}
                                                <a class="layui-btn layui-btn-danger layui-btn-xs sao" lay-event="sao">修改费率</a>
                                            @{{#  } else if(d.ways_type == 16001) { }}
                                                <a class="layui-btn layui-btn-danger layui-btn-xs floweredit" lay-event="floweredit">修改费率</a>
                                            @{{#  } else { }}
                                                <a class="layui-btn layui-btn-danger layui-btn-xs edit" lay-event="edit">修改费率</a>
                                            @{{#  } }}

                                            @{{#  if(d.company == "jdjr"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs pay" lay-event="pay">商户号</a>
                                            @{{#  } else if(d.company == "alipay"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs alipay" lay-event="alipay">商户号</a>
                                            @{{#  } else if(d.company == "newland"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs newland" lay-event="newland">商户号</a>
                                            @{{#  } else if(d.company == "herongtong"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs hrt" lay-event="hrt">商户号</a>
                                            @{{#  } else if(d.company == "ltf"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs ltf" lay-event="ltf">商户号</a>
                                            @{{#  } else if(d.company == "dlb"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs dlb" lay-event="dlb">商户号</a>
                                            @{{#  } else if(d.company == "tfpay"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs tf" lay-event="tf">商户号</a>
                                            @{{#  } else if(d.company == "vbill"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs sxf" lay-event="sxf">商户号</a>
                                            @{{#  } else if(d.company == "weixin"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs openweixin" lay-event="openweixin">商户号</a>
                                            @{{#  } else if(d.company == "lianfu"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs lianfu" lay-event="lianfu">商户号</a>
                                            @{{#  } else if(d.company == "hltx"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs hltx" lay-event="hltx">商户号</a>
                                             @{{#  } else if(d.company == "nongjin"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs nongjin" lay-event="nongjin">商户号</a>
                                            @{{#  } else if(d.company == "gs_nongjin"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs gs_nongjin" lay-event="gs_nongjin">商户号</a>
                                            @{{#  } else if(d.company == "abc"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs abc" lay-event="abc">商户号</a>
                                             @{{#  } else if(d.company == "abc_quiet"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs abc_quiet" lay-event="abc_quiet">商户号</a>
                                             @{{#  } else if(d.company == "wingpay"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs wingpay" lay-event="wingpay">商户号</a>
                                             @{{#  } else if(d.company == "cool"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs cool" lay-event="cool">商户号</a>
                                             @{{#  } else if(d.company == "saobei"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs saobei" lay-event="saobei">商户号</a>
                                             @{{#  } else if(d.company == "ccb"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs ccb" lay-event="ccb">商户号</a>
                                            @{{#  } else if(d.company == "allinpay"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs allinpay" lay-event="allinpay">商户号</a>
                                               @{{#  } else if(d.company == "pingan"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs pingan" lay-event="pingan">商户号</a>
                                             @{{#  } else if(d.company == "unionpay_merch"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs unionpay_merch" lay-event="unionpay_merch">商户号</a>
                                             @{{#  } else if(d.company == "unionpay_merch_v2"){ }}
                                             <a class="layui-btn layui-btn-normal layui-btn-xs unionpay_merch_v2" lay-event="unionpay_merch_v2">商户号</a>
                                            @{{#  } else if(d.company == "changsha"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs changsha" lay-event="changsha">商户号</a>
                                            @{{#  } else if(d.company == "lianfuyoupay"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs lianfuyoupay" lay-event="lianfuyoupay">商户号</a>
					                        @{{#  } else if(d.company == "huipay"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs huipay" lay-event="huipay">商户号</a>
                                            @{{#  } else if(d.company == "weixina"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs openweixina" lay-event="openweixina">商户号</a>
                                            @{{#  } else if(d.company == "wftpay"){ }}
                    				            <a class="layui-btn layui-btn-normal layui-btn-xs wftpay" lay-event="wftpay">商户号</a>
                    				        @{{#  } else if(d.company == "cib"){ }}
	                                            <a class="layui-btn layui-btn-normal layui-btn-xs cib" lay-event="cib">商户号</a>
                                            @{{#  } else if(d.company == "cqcbank"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs cqcbank" lay-event="cqcbank">商户号</a>

                                            @{{#  } else if(d.company == "yinsheng"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs yinsheng" lay-event="yinsheng">商户号</a>

                                             @{{#  } else if(d.company == "yinka"){ }}
                                             <a class="layui-btn layui-btn-normal layui-btn-xs yinka" lay-event="yinka">商户号</a>

                                             @{{#  } else if(d.company == "cmbc"){ }}
                                             <a class="layui-btn layui-btn-normal layui-btn-xs cmbc" lay-event="cmbc">商户号</a>

                                            @{{#  } else if(d.company == "hwcpay"){ }}
                    				            <a class="layui-btn layui-btn-normal layui-btn-xs hwcpay" lay-event="hwcpay">商户号</a>
                                            @{{#  } else if(d.company == "easypay"){ }}
                    				            <a class="layui-btn layui-btn-normal layui-btn-xs easypay" lay-event="easypay">商户号</a>
                    				        @{{#  } else if(d.company == "jiujiang"){ }}
                    				            <a class="layui-btn layui-btn-normal layui-btn-xs jiujiang" lay-event="jiujiang">商户号</a>
                                             @{{#  } else if(d.company == "dongguan"){ }}
                                             <a class="layui-btn layui-btn-normal layui-btn-xs dongguan" lay-event="dongguan">商户号</a>
                                            @{{#  } else if(d.company == "linkage"){ }}
                    				            <a class="layui-btn layui-btn-normal layui-btn-xs linkage" lay-event="linkage">商户号</a>
                                            @{{#  } else { }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs open" lay-event="open">商户号</a>
                                            @{{#  } }}

                                            @{{#  if(d.company == "mybank" || d.company == "jdjr" || d.company == "newland" || d.company == "herongtong" || d.company == "fuiou"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs js" lay-event="js">开通通道</a>
                                            @{{#  } else if(d.company == "alipay"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs alipaycode" lay-event="alipaycode">开通通道</a>
                                            @{{#  } else if(d.company == "tfpay"){ }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs js_tf" lay-event="js_tf">开通通道</a>
                                            @{{#  } else if(d.company == "hltx"){ }}
                                            <a class="layui-btn layui-btn-normal layui-btn-xs js_hltx" lay-event="js_hltx">开通通道</a>
                                            @{{#  } else { }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs js" lay-event="js">开通通道</a>
                                            @{{#  } }}
                                             <!--<a class="layui-btn layui-btn-normal layui-btn-xs delpassway" lay-event="delpassway">清除通道</a>
                                            <a class="layui-btn layui-btn-normal layui-btn-xs passwaydisable" lay-event="passwaydisable">通道禁用</a>-->

                                            @{{#  if(d.company == "vbill"){  }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs check_results" lay-event="check_results">进件查询</a>
                                            @{{#  } else if(d.company == "linkage"){  }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs check_linkage_results" lay-event="check_linkage_results">进件查询</a>
                                            @{{#  } else if(d.company == "wingpay"){  }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs check_wingpay_results" lay-event="check_wingpay_results">进件查询</a>
                                            @{{#  } else if(d.company == "yinsheng"){  }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs check_icbc_results" lay-event="check_yinsheng_results">进件查询</a>
                                            @{{#  } else { }}
                                                <a class="layui-btn layui-btn-normal layui-btn-xs check_linkage_results" lay-event="check_cha_results">进件查询</a>
                                            @{{#  } }}
                                            
                                            <a class="layui-btn layui-btn-normal layui-btn-xs configure_channel" lay-event="configure_channel">通道配置</a>
                                            
                                            <a class="layui-btn layui-btn-normal layui-btn-xs vbill_del" lay-event="vbill_del" style="background-color:red">清除通道</a>
                                            <a class="layui-btn layui-btn-normal layui-btn-xs sub_merchant" lay-event="sub_merchant" style="background-color:red">子商户号</a>
                                        </script>
                                    </div>
                                </div>
                                <a class="layui-btn layui-btn-normal layui-btn-xs sort" lay-event="sort" lay-href='' style="margin:20px;">修改收款顺序</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="edit_rate" class="hide" style="display: none;background-color: #fff;">
            <div class="xgrate">修改费率</div>
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">费率:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入修改费率" class="layui-input rate">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn submit">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="edit_shua" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">门店名称:</label>
                        <div class="layui-input-block" style="line-height: 36px;">
                            <div class="agent"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block" style="line-height: 36px;">
                            <div class="ways"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">贷记卡费率:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入贷记卡费率" class="layui-input rate1">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">借记卡费率:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入借记卡费率" class="layui-input rate2">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">借记卡封顶:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入借记卡封顶" class="layui-input rate3">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn submits">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <input type="hidden" class="types">
        </div>

        <div id="open_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="xgrate">输入商户号</div>
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input wx_sub_merchant_id">
                        </div>
                    </div>
                    <div class="layui-form-item wx_list">
                        <label class="layui-form-label">微信支付目录:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入微信支付目录" class="layui-input wx_path">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                        <button class="layui-btn open_way">确定</button>
                        </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_passway_lianfu" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                     <div class="layui-form-item">
                        <label class="layui-form-label">分行配置:</label>
                        <div class="layui-input-block">
                            <select name="icbc_type" class="icbc_type" lay-filter="icbc_type">
                                <option value="11000000000000013347">徐州</option>
                                <option value="11000000000000025799">淮北</option>
                                <option value="10000000000003233525">阜阳</option>
                                <option value="10000000000003212249">天津</option>
                                <option value="11000000000000021944">合肥</option>
                                <option value="11000000000000025956">宣城</option>
                                <option value="11000000000000035208">宿州</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input lianfu_sub_merchant_id">
                        </div>
                    </div>
                    <!--<div class="layui-form-item lianfushow">-->
                    <!--    <label class="layui-form-label">APPID:</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <input type="text" placeholder="请输入signkey" class="layui-input lianfuappid">-->
                    <!--    </div>-->
                    <!--</div>-->
                    <!--<div class="layui-form-item lianfushow">-->
                    <!--    <label class="layui-form-label">Msgid:</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <input type="text" placeholder="请输入signkey" class="layui-input lianfukey">-->
                    <!--    </div>-->
                    <!--</div>-->
{{--                    <div class="layui-form-item wx_list">--}}
{{--                        <label class="layui-form-label">微信支付目录:</label>--}}
{{--                        <div class="layui-input-block">--}}
{{--                            <input type="text" placeholder="请输入微信支付目录" class="layui-input lianfu_wx_path">--}}
{{--                        </div>--}}
{{--                    </div>--}}
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn lianfuButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div id="open_passway_nongjin" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input nongjin_sub_merchant_id">
                        </div>
                    </div>
                    
                    <div class="layui-form-item nongjinkey">
                        <label class="layui-form-label">农金key:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入农金key" class="layui-input nongjinkey1">
                        </div>
                    </div>
                    
                    <div class="layui-form-item zhongduanid">
                        <label class="layui-form-label">终端号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入终端号" class="layui-input zhongduanid1">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn nongjinButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
         <div id="open_passway_gsnongjin" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input gsnongjin_merchant_id">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn gsnongjinButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div id="open_passway_abc" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input abc_sub_merchant_id">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">集团号（app_id）:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入集团号（app_id）" class="layui-input abckey">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">终端号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入终端号" class="layui-input abczhongduanid">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">农行公钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入终端号" class="layui-input abcpublic_rsa_key">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">自身私钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入终端号" class="layui-input abcprivate_rsa_key">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn abcButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
         <div id="open_passway_abc_quiet" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input abc_quiet_merchant_id">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">收银点编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入收银点编号" class="layui-input abc_quiet_cashier_id">
                        </div>
                    </div>
                    
                     <div class="layui-form-item">
                        <label class="layui-form-label">对方公钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入对方公钥" class="layui-input abc_quiet_public_key">
                        </div>
                    </div>
                     <div class="layui-form-item">
                        <label class="layui-form-label">自身私钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入自身私钥" class="layui-input abc_quiet_private_key">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn abc_quietButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
         <div id="open_passway_wingpay" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">平台商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入平台商户号" class="layui-input wing_institutionCode">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">交易商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入交易商户号" class="layui-input wing_merchantNo">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn wingButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
         <div id="open_passway_cool" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input cool_merchantNo">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">secret_key:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入交易商户号" class="layui-input cool_secretkey">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn coolButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div id="open_passway_saobei" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input saobei_merchantNo">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">终端号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入终端号" class="layui-input saobei_zhongduan">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">access_token:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入access_token" class="layui-input saobei_token">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn saobeiButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
         <div id="open_passway_ccb" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input ccb_merchantid">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">柜台号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入柜台号" class="layui-input ccb_posid">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">分行号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入分行号" class="layui-input ccb_bankchid">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">公钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入分行号" class="layui-input ccb_pubkey">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn ccbButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_passway_allinpay" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">机构号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入机构号" class="layui-input orgid">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input cusid">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">应用ID:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入终端号" class="layui-input allinpay_appid">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">公钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入公钥" class="layui-input allinpay_pubkey">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">私钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入公钥" class="layui-input allinpay_prikey">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn allinpayButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div id="open_passway_pingan" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input pingan_merchant_id">
                        </div>
                    </div>
                    
                     <div class="layui-form-item">
                        <label class="layui-form-label">商户注册码:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户注册码" class="layui-input pingan_enterpriseReg">
                        </div>
                    </div>
                    
                    <!--<div class="layui-form-item">-->
                    <!--    <label class="layui-form-label">APPID:</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <input type="text" placeholder="请输入APPID" class="layui-input pingan_appid">-->
                    <!--    </div>-->
                    <!--</div>-->
                    
                    <!--<div class="layui-form-item">-->
                    <!--    <label class="layui-form-label">APPSECRET:</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <input type="text" placeholder="请输入APPSECRET" class="layui-input pingan_appsecret">-->
                    <!--    </div>-->
                    <!--</div>-->
                    
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn pinganButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div id="open_passway_unionpay_merch" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">APPID:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入appid" class="layui-input merch_appid">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">APPKEY:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入集团号" class="layui-input merch_appkey">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input merch_sub_merchant_id">
                        </div>
                    </div>
                    
                    <div class="layui-form-item">
                        <label class="layui-form-label">终端号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入终端号" class="layui-input merchzhongduanid">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn merchButton">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_passway_unionpay_merch_v2" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">APPID:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入appid" class="layui-input merch_appid">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">APPKEY:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入集团号" class="layui-input merch_appkey">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input merch_sub_merchant_id">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">终端号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入终端号" class="layui-input merchzhongduanid">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn merchV2Button">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_passway_weixin" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input wx_sub_merchant_id_shop">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">微信支付目录:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入微信支付目录" class="layui-input wx_path_shop">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">优惠商品ID:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入优惠商品ID" class="layui-input wx_shop">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn open_way_weixin">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_tf_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item tf_show">
            <span class="layui-form-label">渠道子商户号:</span>
            <span class="qd_item2" style='line-height: 36px;'>渠道子商户号:</span>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">商户号:</label>
            <div class="layui-input-block">
                <input type="text" placeholder="请输入商户号" class="layui-input tf_merchant_id">
            </div>
          </div>
          <div class="layui-form-item qdopen" style="margin:20px 0 30px 0;">
            <label class="layui-form-label">渠道</label>
            <div class="layui-input-block">
              <select name="tf_qdopen" id="tf_qdopen" lay-filter="tf_qdopen">
                  <option value="">选择渠道</option>
                  <option value="1">渠道1</option>
                  <option value="2">渠道2</option>
              </select>
            </div>
          </div>
          <div class="layui-form-item wx_list">
            <label class="layui-form-label">微信支付目录:</label>
            <div class="layui-input-block">
                <input type="text" placeholder="请输入微信支付目录" class="layui-input wx_path_tf">
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
                <div class="layui-footer" style="left: 0;">
                    <button class="layui-btn save_tf">确定</button>
                </div>
            </div>
          </div>
        </div>
      </div>
    </div>

        <div id="newland" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入商户号" class="layui-input wxmerchantda">
                        </div>
                    </div>
                    <div class="layui-form-item wx_list">
                        <label class="layui-form-label">微信子公众号id:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入微信子公众号id" class="layui-input wxsubappid">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户密钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户密钥" class="layui-input wxmerchantdb">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">设备号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入设备号" class="layui-input wxmerchantdc">
                        </div>
                    </div>
                    <div class="layui-form-item wx_list">
                        <label class="layui-form-label">微信支付目录:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入微信支付目录" class="layui-input wx_path_newland">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn save_newland">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div id="sub_merchant" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">微信子商户号:</label>
                        <div class="layui-input-block">
                            <view class="layui-input wxmerchantcode"></view>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">支付宝子商户号:</label>
                        <div class="layui-input-block">
                            <view class="layui-input alimerchantcode"></view>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_alipay" class="hide" style="display: none;background-color: #fff;">
        <div class="xgrate">开通通道</div>
            <div class="layui-card-body" style="padding: 15px;text-align: center;">
                <div style="padding-bottom:10px;">支付宝授权</div>
                <div class="img" id="code"><img src=""></div>
            </div>
        </div>

        <div id="open_js" class="hide" style="display: none;background-color: #fff;">
            <div class="xgrate">开通通道</div>
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item xingzhi" style="margin:20px 0 30px 0">
                        <label class="layui-form-label">结算类型</label>
                        <div class="layui-input-block">
                            <select name="open" id="open" lay-filter="open"></select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn open_jiesuan">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_tf_js" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item js_openTf" style="margin:20px 0 30px 0">
                        <label class="layui-form-label">结算类型</label>
                        <div class="layui-input-block">
                            <select name="openTf" id="openTf" lay-filter="openTf">
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item qdopen" style="margin:20px 0 30px 0;">
                        <label class="layui-form-label">渠道</label>
                        <div class="layui-input-block">
                            <select name="qdopen" id="qdopen" lay-filter="qdopen">
                    <option value="">选择渠道</option>
                                <option value="1">渠道1</option>
                                <option value="2" selected>渠道2</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn open_tf_jiesuan">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_hltx_js" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;height: 260px;">
                <div class="layui-form">

                    <div class="layui-form-item js_openTf" style="margin:20px 0 30px 0">
                        <label class="layui-form-label">结算类型</label>
                        <div class="layui-input-block">
                            <select name="openhltx" id="openhltx" lay-filter="openhltx">

                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item qdopen" style="margin:20px 0 30px 0;">
                        <label class="layui-form-label">渠道</label>
                        <div class="layui-input-block">
                            <select name="hltx_qdopen" id="hltx_qdopen" lay-filter="hltx_qdopen">
                                <option value="">选择渠道</option>
                                <option value="1">渠道1</option>
                                <option value="2">渠道2</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn open_hltx_jiesuan">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="edit_sao" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">门店名称:</label>
                        <div class="layui-input-block" style="line-height: 36px;">
                            <div class="agent"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block" style="line-height: 36px;">
                            <div class="ways"></div>
                        </div>
                    </div>
                    <div style="padding: 20px;">金额 0-1000</div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">贷记卡费率:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入贷记卡费率" class="layui-input rates1">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">借记卡费率:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入借记卡费率" class="layui-input rates2">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">借记卡封顶:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入借记卡封顶" class="layui-input rates3">
                        </div>
                    </div>

                    <div style="padding: 20px;">金额 大于1000</div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">贷记卡费率:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入贷记卡费率" class="layui-input rates4">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">借记卡费率:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入借记卡费率" class="layui-input rates5">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">借记卡封顶:</label>
                        <div class="layui-input-block">
                            <input type="number" placeholder="请输入借记卡封顶" class="layui-input rates6">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn submitsao">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_passways" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input wx_sub_hrt">
                        </div>
                    </div>
                    <div class="layui-form-item wx_list">
                        <label class="layui-form-label">微信支付目录:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入微信支付目录" class="layui-input wx_path_hrt">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn open_ways">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_ltf" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">merchantCode:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入merchantCode" class="layui-input ltf1">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">md_key:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入md_key" class="layui-input ltf2">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">appId:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入appId" class="layui-input ltf3">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn open_ltf_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <input type="hidden" class="ltf_type">
        </div>

        <div id="alipay_store_id" class="hide" style="display: none;background-color: #fff;">
            <div class="xgrate">商户号</div>
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block" style="line-height: 36px;">
                            <div class="alipayway"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">口碑外部ID:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入口碑外部ID" class="layui-input wx_sub_alipay_wai">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">口碑门店ID:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入口碑门店ID" class="layui-input wx_sub_alipay">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn open_alipay_store_id">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <input type="hidden" class="alipaytype">
        </div>

        <div id="dlb" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户编号" class="layui-input dlb_inputs">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">门店编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入门店编号" class="layui-input dlb_inputs">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">机具编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入机具编号" class="layui-input dlb_inputs">
                        </div>
                    </div>
                    <div class="layui-form-item wx_list">
                        <label class="layui-form-label">微信支付目录:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入微信支付目录" class="layui-input wx_path_dlb">
                        </div>
                    </div>
                    <input type="hidden" class="dlb_type">
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn open_dlb_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="vbill" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input sxf_input1">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">微信渠道号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input sxf_input2">
                        </div>
                    </div>
                    <div class="layui-form-item wx_list">
                        <label class="layui-form-label">微信支付目录:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入微信支付目录" class="layui-input wx_path_sxf">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn sxf_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div id="configure_channel" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px; height: 800px">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 40%">当前配置通道:</label>
                        <div class="layui-input-block" style="margin-left: 50%;"><div class="way"></div></div>
                        <input type="hidden" style="display: none" class="configure_channel_company" value="">
                    </div>
                    <div class="layui-form-item js_openTf" style="margin:20px 0 30px 0">
                        <label class="layui-form-label" style="width: 40%">扣费模式</label>
                        <div class="layui-input-block" style="margin-left: 50%;">
                            <select name="type_mode" id="type_mode" class="model" lay-filter="type_mode">
                                <option class="model4" value="4">预充模式</option>
                                <option class="model2" value="2">代扣模式</option>
                                <option class="model3" value="3">通道扣费</option>
                                <option class="model1" value="1">服务费模式</option>
                            </select>
                        </div>
                    </div>

                    <div class="yuchong" style="display: none">
                        <div class="agent_level_yuchong"></div>
                        <div>
                            <div class="layui-form-item qdopen" style="margin:20px 0 30px 0;">
                            <div class="layui-input-block channel_radio" lay-event="deduction">
                                <input type="radio" name="channel" lay-filter="channel" class="layui-input channel_radio channel_radio1" value="1" checked>费率统一
                                <!--<input type="radio" name="channel" lay-filter="channel" class="layui-input channel_radio channel_radio2" value="2">费率不一-->
                            </div>
                        </div>
    
                        <div class="layui-form-item channel1">
                            <label class="layui-form-label" style="width: 40%">流量费率:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入流量费率" class="layui-input configure_channel_fee"></div>
                        </div>
                         <div class="layui-form-item channel1">
                            <label class="layui-form-label" style="width: 40%">提醒额度(一):</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入预充第一次警告额度" class="layui-input money_level1"></div>
                        </div>
                         <div class="layui-form-item channel1">
                            <label class="layui-form-label" style="width: 40%">提醒额度(二):</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入预充第二次警告额度" class="layui-input money_level2"></div>
                        </div>
                        <div class="layui-form-item channel1">
                            <label class="layui-form-label" style="width: 40%">提醒额度(三):</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入预充第三次警告额度" class="layui-input money_level3"></div>
                        </div>
    
                        <div class="channel2" style="display: none">
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 40%">支付宝:</label>
                                <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入支付宝费率" class="layui-input configure_channel_zfb"></div>
                            </div>
    
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 40%">微信:</label>
                                <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入微信费率" class="layui-input configure_channel_weixin"></div>
                            </div>
    
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 40%">云闪付:</label>
                                <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入云闪付费率" class="layui-input configure_channel_cloud"></div>
                            </div>
    
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 40%">刷卡-储蓄卡:</label>
                                <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入刷卡-储蓄卡费率" class="layui-input configure_channel_debit"></div>
                            </div>
    
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 40%">刷卡-信用卡:</label>
                                <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入刷卡-信用卡费率" class="layui-input configure_channel_credit"></div>
                            </div>
                        </div>
                        </div>
                    </div>
                    <div class="fuwufei" style="display: none">
                        <div class="agent_level_fuwufei"></div>
                        <div>
                                <div class="layui-form-item qdopen" style="margin:20px 0 30px 0;">
                                <div class="layui-input-block channel_radio" lay-event="deduction">
                                <input type="radio" name="channel_fuwu" lay-filter="channel" class="layui-input channel_radio" value="1" checked>费率统一
                                <!--<input type="radio" name="channel" lay-filter="channel" class="layui-input channel_radio channel_radio2" value="2">费率不一-->
                            </div>
                        </div>
    
                        <div class="layui-form-item channel1">
                            <label class="layui-form-label" style="width: 40%">服务费率:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入服务费率" class="layui-input configure_channel_fee_fuwu"></div>
                        </div>
    
                        <div class="channel2" style="display: none">
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 40%">支付宝:</label>
                                <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入支付宝费率" class="layui-input configure_channel_zfb_fuwu"></div>
                            </div>
    
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 40%">微信:</label>
                                <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入微信费率" class="layui-input configure_channel_weixin_fuwu"></div>
                            </div>
    
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 40%">云闪付:</label>
                                <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入云闪付费率" class="layui-input configure_channel_cloud_fuwu"></div>
                            </div>
    
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 40%">刷卡-储蓄卡:</label>
                                <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入刷卡-储蓄卡费率" class="layui-input configure_channel_debit_fuwu"></div>
                            </div>
    
                            <div class="layui-form-item">
                                <label class="layui-form-label" style="width: 40%">刷卡-信用卡:</label>
                                <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入刷卡-信用卡费率" class="layui-input configure_channel_credit_fuwu"></div>
                            </div>
                        </div></div>
                    </div>
                    <div class="tongdao" style="display: none">
                        <div class="agent_level"></div>
                        <div>
                        <div class="layui-form-item qdopen" style="margin:20px 0 30px 0;">
                        <div class="layui-input-block channel_radio" lay-event="deduction">
                            <input type="radio" name="channel_tongdao" lay-filter="channel" class="layui-input channel_radio" value="1" checked>费率统一
                            <!--<input type="radio" name="channel" lay-filter="channel" class="layui-input channel_radio channel_radio2" value="2">费率不一-->
                        </div>
                    </div>

                    <div class="layui-form-item channel1">
                        <label class="layui-form-label" style="width: 40%">通道费率:</label>
                        <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入通道费率" class="layui-input configure_channel_fee_tongdao"></div>
                    </div>

                    <div class="channel2" style="display: none">
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 40%">支付宝:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入支付宝费率" class="layui-input configure_channel_zfb_tongdao"></div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 40%">微信:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入微信费率" class="layui-input configure_channel_weixin_tongdao"></div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 40%">云闪付:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入云闪付费率" class="layui-input configure_channel_cloud_tongdao"></div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 40%">刷卡-储蓄卡:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入刷卡-储蓄卡费率" class="layui-input configure_channel_debit_tongdao"></div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 40%">刷卡-信用卡:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入刷卡-信用卡费率" class="layui-input configure_channel_credit_tongdao"></div>
                        </div>
                    </div></div>
                    </div>
                    <div class="daikou" style="display: none">
                        <div class="agent_level_daikou"></div>
                        <div>
                        <div class="layui-form-item qdopen" style="margin:20px 0 30px 0;">
                        <div class="layui-input-block channel_radio" lay-event="deduction">
                            <input type="radio" name="channel_daikou" lay-filter="channel" class="layui-input channel_radio" value="1" checked>费率统一
                            <!--<input type="radio" name="channel" lay-filter="channel" class="layui-input channel_radio channel_radio2" value="2">费率不一-->
                        </div>
                    </div>

                    <div class="layui-form-item channel1">
                        <label class="layui-form-label" style="width: 40%">代扣费率:</label>
                        <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入代扣费率" class="layui-input configure_channel_fee_daikou"></div>
                    </div>

                    <div class="channel2" style="display: none">
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 40%">支付宝:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入支付宝费率" class="layui-input configure_channel_zfb_daikou"></div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 40%">微信:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入微信费率" class="layui-input configure_channel_weixin_daikou"></div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 40%">云闪付:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入云闪付费率" class="layui-input configure_channel_cloud_daikou"></div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 40%">刷卡-储蓄卡:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入刷卡-储蓄卡费率" class="layui-input configure_channel_debit_daikou"></div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 40%">刷卡-信用卡:</label>
                            <div class="layui-input-block" style="margin-left: 50%;"><input type="number" placeholder="请输入刷卡-信用卡费率" class="layui-input configure_channel_credit_daikou"></div>
                        </div>
                    </div></div>
                    </div>

                    <div class="layui-form-item"><div class="layui-input-block" style="text-align: center; margin-left: 0; margin-left: 45%; margin-top: 30px;"><div class="layui-footer" style="left: 0;"><button class="layui-btn configure_channel_submit">确定</button></div></div></div>
                </div>
            </div>
        </div>

        <div id="edit_flower" class="hide" style="display: none;background-color: #fff;">
      <div class="layui-card-body" style="padding: 15px;">
        <div class="layui-form f_box" lay-filter="component-form-group">

        <!--   <div class="layui-form-item">
            <label class="layui-form-label" >3期:</label>
            <div class="layui-input-block f_block">
              <input type="text" placeholder="请输入商户编号" class="layui-input f_inputs">
            </div>

            <button class="layui-btn open_f_save">确定</button>
          </div>  -->

          <div class="layui-unselect layui-form-checkbox" lay-skin="primary">
            <span>阅读</span>
            <i class="layui-icon layui-icon-ok"></i>
          </div>
        </div>
        <!-- <button class="layui-btn returnSettings">返还设置</button> -->
        <a class="layui-btn layui-btn-normal layui-btn-xs returnSettings" lay-event="returnSettings" lay-href="">返还设置</a>
      </div>
    </div>

        <div id="open_disable" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">

                    <div class="layui-form-item js_openTf" style="margin:20px 0 0px 0">
                        <label class="layui-form-label" style="width: 100px;">通道开启关闭</label>
                        <div class="layui-input-block" style="margin-left: 130px;">
                            <select name="passway1" id="passway1" lay-filter="passway1">
                                <option value="0">开启</option>
                                <option value="1">关闭</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item qdopen" style="margin:20px 0 0px 0;">
                        <label class="layui-form-label" style="width: 100px;">B扫C信用通道</label>
                        <div class="layui-input-block" style="margin-left: 130px;">
                            <select name="passway2" id="passway2" lay-filter="passway2">
                                <option value="01">开启</option>
                                <option value="00">关闭</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item qdopen" style="margin:20px 0 30px 0;">
                        <label class="layui-form-label" style="width: 100px;">C扫B信用通道</label>
                        <div class="layui-input-block" style="margin-left: 130px;">
                            <select name="passway3" id="passway3" lay-filter="passway3">
                                <option value="01">开启</option>
                                <option value="00">关闭</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="width: 100px;">单笔限额:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入单笔限额" class="layui-input dbxe" style="width: 94%;">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn save_display">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="hltx_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">渠道商户号:</label>
                        <div class="layui-input-block">
                            <div class="waynum"></div>
                        </div>
                    </div>
                    <div class="layui-form-item qdopen" style="margin:20px 0 30px 0;">
                        <label class="layui-form-label">渠道</label>
                        <div class="layui-input-block">
                            <select name="hltx_qdopen_td" id="hltx_qdopen_td" lay-filter="hltx_qdopen_td">
                                <option value=''>选择渠道</option>
                                <option value="1">渠道1</option>
                                <option value="2">渠道2</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input hltx_wx_sub_merchant_id">
                        </div>
                    </div>
                    <div class="layui-form-item wx_list">
                        <label class="layui-form-label">微信支付目录:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入微信支付目录" class="layui-input hltx_wx_path">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn hltx_way">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="changsha_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input changsha_wx_sub_merchant_id">
                        </div>
                    </div>
                    <div class="layui-form-item changsha_list">
                        <label class="layui-form-label">微信支付目录:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入微信支付目录" class="layui-input changsha_wx_path">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">门店编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入门店编号" class="layui-input store_num">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">收银员编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入收银员编号" class="layui-input merchant_num">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn changsha_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="lianfuyoupay_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">分行配置:</label>
                        <div class="layui-input-block">
                            <select name="you_type" class="you_type" lay-filter="you_type">
                                <option value="1">安徽邮储</option>
                                <option value="2">西安邮储</option>
                                <option value="3">山东邮储</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input lianfuyoupay_merchant_id">
                        </div>
                    </div>
                    <!--<div class="layui-form-item">-->
                    <!--    <label class="layui-form-label">POS_SN:</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <input type="text" placeholder="请输入pos_sn" class="layui-input pos_sn">-->
                    <!--    </div>-->
                    <!--</div>-->
                    <!--<div class="layui-form-item">-->
                    <!--    <label class="layui-form-label">signkey:</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <input type="text" placeholder="请输入signkey" class="layui-input lianfuyoupaykey">-->
                    <!--    </div>-->
                    <!--</div>-->
                    <!--<div class="layui-form-item lianfuyoupay_list">-->
                    <!--    <label class="layui-form-label">微信支付目录:</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <input type="text" placeholder="请输入微信支付目录" class="layui-input lianfuyoupay_wx_path">-->
                    <!--    </div>-->
                    <!--</div>-->
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn lianfuyoupay_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_easypay_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <!--<div class="layui-form-item">-->
                    <!--    <label class="layui-form-label">原操作流水号:</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <input type="text" placeholder="请输入终端商户号" class="layui-input easypay_operatrace">-->
                    <!--    </div>-->
                    <!--</div>-->
                    <div class="layui-form-item">
                        <label class="layui-form-label">终端商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入终端商户号" class="layui-input easypay_mercode">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">终端终端号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入终端终端号" class="layui-input easypay_termcode">
                        </div>
                    </div>
                     <div class="layui-form-item">
                        <label class="layui-form-label">私钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="私钥" class="layui-input easypay_private_key">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn easypay_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_passway_weixina" class="hide" style="display: none;background-color: #fff;">
            <form class="layui-form">
                <div class="layui-card-body">
                    <div class="layui-form" style="padding: 15px;height:750px">
                        <div class="layui-form-item">
                            <label class="layui-form-label">通道:</label>
                            <div class="layui-input-block">
                                <div class="way"></div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">商户号:</label>
                            <div class="layui-input-block">
                                <input type="text" placeholder="请输入商户号" name="wxa_sub_merchant_id_shop" class="layui-input wxa_sub_merchant_id_shop">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信支付目录:</label>
                            <div class="layui-input-block">
                                <input type="text" placeholder="请输入微信支付目录" class="layui-input wxa_path_shop">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">优惠商品ID:</label>
                            <div class="layui-input-block">
                                <input type="text" placeholder="请输入优惠商品ID" class="layui-input wxa_shop">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <div class="layui-footer" style="left: 0;">
                                    <button type="submit" lay-submit="" lay-filter="open_way_weixina" class="layui-btn open_way_weixina">确定</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>

        <div id="open_wftpay_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input wftpay_mch_id">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn wftpay_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
         <!--银卡-->
    <div id="open_yinka_passway" class="hide" style="display: none;background-color: #fff;">
        <div class="layui-card-body" style="padding: 15px;">
            <div class="layui-form">
                <div class="layui-form-item">
                    <label class="layui-form-label">通道:</label>
                    <div class="layui-input-block">
                        <div class="way"></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商户编号:</label>
                    <div class="layui-input-block">
                        <input type="text" placeholder="请输入门店编号" class="layui-input yinka_unique_id">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">设备 sn 号:</label>
                    <div class="layui-input-block">
                        <input type="text" placeholder="请输入设备 sn 号" class="layui-input yinka_sn">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">应用ID:</label>
                    <div class="layui-input-block">
                        <input type="text" placeholder="请输入应用ID" class="layui-input yinka_id">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">密钥:</label>
                    <div class="layui-input-block">
                        <input type="text" placeholder="请输入密钥" class="layui-input yinka_key">
                    </div>
                </div>
                  <div class="layui-form-item">
                    <label class="layui-form-label">私钥:</label>
                    <div class="layui-input-block">
                        <input type="text" placeholder="请输入密钥" class="layui-input yinka_pri_key">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn yinka_save">确定</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--银卡-->

        <!--民生-->
        <div id="open_cmbc_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:民生</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入门店编号" class="layui-input cmbc_mch_id">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">私钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入密钥" class="layui-input cmbc_private_key">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn cmbc_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--民生-->

        <!--银盛-->
        <div id="open_yinsheng_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户" class="layui-input yinsheng_seller_id">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn yinsheng_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
         <!--兴业银行-->
        <div id="open_cib_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input cib_mch_id">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn cib_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--兴业银行-->
        
        
         <!--重庆银行-->
        <div id="open_cqcbank_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input cqcbank_mch_id">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn cqcbank_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--重庆银行-->

        <div id="open_hwcpay_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">平台门店编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入门店编号" class="layui-input hwcpay_mch_id">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户编号" class="layui-input hwcpay_merchant_num">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn hwcpay_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="open_linkage_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">报备编号:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入报备编号" class="layui-input linkageMerId">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号(联动平台分配):</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入商户号" class="layui-input linkageAcqMerId">
                        </div>
                    </div>
                    <div class="layui-form-item wx_list">
                        <label class="layui-form-label">子商户SubAPPID:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入子商户SubAPPID" class="layui-input linkageSubAppid">
                        </div>
                    </div>
                    <div class="layui-form-item wx_list">
                        <label class="layui-form-label">微信子商户号subMchId:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="微信子商户号subMchId" class="layui-input linkageSubMchId">
                        </div>
                    </div>
                    <div class="layui-form-item wx_list">
                        <label class="layui-form-label">微信支付目录:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入微信支付目录" class="layui-input linkage_wx_path">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn linkage_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="open_jiujiang_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block"><input type="text" placeholder="请输入商户号" class="layui-input jiujiang_mchtNo"></div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">终端号:</label>
                        <div class="layui-input-block"><input type="text" placeholder="请输入子商户" class="layui-input jiujiang_termNo"></div>
                    </div>
                    <!--<div class="layui-form-item">-->
                    <!--    <label class="layui-form-label">私钥:</label>-->
                    <!--    <div class="layui-input-block">-->
                    <!--        <input type="text" placeholder="请输入私钥" class="layui-input jiujiang_private_key">-->
                    <!--    </div>-->
                    <!--</div>-->
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn jiujiang_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <div id="open_dongguan_passway" class="hide" style="display: none;background-color: #fff;">
            <div class="layui-card-body" style="padding: 15px;">
                <div class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label">通道:</label>
                        <div class="layui-input-block">
                            <div class="way"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">商户号:</label>
                        <div class="layui-input-block"><input type="text" placeholder="请输入商户号" class="layui-input dongguan_mchtNo"></div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">终端号:</label>
                        <div class="layui-input-block"><input type="text" placeholder="请输入子商户" class="layui-input dongguan_termNo"></div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">私钥:</label>
                        <div class="layui-input-block">
                            <input type="text" placeholder="请输入私钥" class="layui-input dongguan_private_key">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <div class="layui-footer" style="left: 0;">
                                <button class="layui-btn dongguan_save">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

    <input type="hidden" class="passway1" value="0">
    <input type="hidden" class="passway2" value="01">
    <input type="hidden" class="passway3" value="01">
    <input type="hidden" class="passway_company">
    <input type="hidden" class="passway_ways_type">

    <input type="hidden" class="type">
    <input type="hidden" class="types">
    <input type="hidden" class="js">
    <input type="hidden" class="you_type">
    <input type="hidden" class="icbc_type">
    <input type="hidden" class="js_open_tf">
    <input type="hidden" class="qd" value="2">
    <input type="hidden" class="hltxqd" value="">
    <input type="hidden" class="tfqd" value="">
    <input type="hidden" class="ways_source" value="">

<script src="{{asset('/layuiadmin/layui/layui.js')}}"></script>
<script src="{{asset('/layuiadmin/layui/jquery-2.1.4.js')}}"></script>
<script src="{{asset('/layuiadmin/layui/jquery.qrcode.min.js')}}"></script>
<!--<script src="{{asset('/layuiadmin/jquery.min.js')}}"></script>-->
<script src="{{asset('/layuiadmin/jquerysession.js')}}"></script>
<script>
    var token = localStorage.getItem("Usertoken");
    var store_name = localStorage.getItem("store_store_name");
    var agentName = localStorage.getItem("agentName");
    var str=location.search;
    var store_id=str.split('?')[1];

    layui.config({
        base: '../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','form','table','laydate'], function(){
        var $ = layui.$
        ,admin = layui.admin
        ,form = layui.form
        ,table = layui.table
        ,laydate = layui.laydate;

        // 未登录,跳转登录页面
        $(document).ready(function(){
            if(token==null){
                window.location.href="{{url('/user/login')}}";
            }
            if(store_id!=undefined || store_id!=''){
                $('.returnSettings').show()
            }
        });
        
        
        var pass =$.session.get('pass');
        // 重置cookie有效期
        var time = Date.parse(new Date()) + (5 * 60 * 1000);
        $.session.set('time', time);
    //     var form = layui.form;
    	form.on('select(type_mode)', function(data){
    		var type = data.value;
    		var company = $('.configure_channel_company').val()
    		
    		
    		$.post("{{url('/api/glow/agent_level')}}", {
                token: token,
                store_id: store_id,
                company: company,
                model:type
            }, function(res){
                
                console.log( $('#type_mode').val() )
                console.log( res.data.configure_channel.model )
                
                if( res.status == '2' ){
                    // var model = res.data.configure_channel.model;
                    var model=type;
                    if(model==2){
            		    $(".daikou").show();
            		    $(".tongdao").hide();
            		    $(".fuwu").hide();
            		    $(".yuchong").hide();
                        $('.configure_channel_submit').attr( 'style', 'display: none' ); // 隐藏 提交按钮
                        $("input:radio[name=channel_daikou][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                        form.render('radio');
                        //根据值让option选中 
                        $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                		layui.form.render("select");
                        $('.configure_channel_fee_daikou').val( res.data.configure_channel.configure_channel_fee ); // 费率
                        
                        var html = '';
                        if( res.status == 1 ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.daikou[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_daikou').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }else if( res.status == '2' ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.daikou[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_daikou').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }
                        
                    }else if(model==4){
                        $(".tongdao").hide();
                        $(".daikou").hide();
            		    $(".fuwu").hide();
            		    $(".yuchong").show();
                        $('.configure_channel_submit').attr( 'style', 'display: none' ); // 隐藏 提交按钮
                        
                        $("input:radio[name=channel][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                        form.render('radio');
                        
                        if(res.data.configure_channel.channel_radio == 1){
                            $(".channel1").show();
                            $(".channel2").hide();
                        }else{
                            $(".channel2").show();
                            $(".channel1").hide();
                        }
                        
                        
                        $('.agency_cost1').attr('value', res.data.configure_channel.users_rate.agency_cost );
                        
                        //根据值让option选中 
                        $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                		layui.form.render("select");
                        
                        $('.configure_channel_fee').val( res.data.configure_channel.configure_channel_fee ); // 费率
                        
                        $('.configure_channel_zfb').val( res.data.configure_channel.configure_channel_zfb );
                        $('.configure_channel_weixin').val( res.data.configure_channel.configure_channel_weixin );
                        $('.configure_channel_cloud').val( res.data.configure_channel.configure_channel_cloud );
                        $('.configure_channel_debit').val( res.data.configure_channel.configure_channel_debit );
                        $('.configure_channel_credit').val( res.data.configure_channel.configure_channel_credit );
                        
                        $('.money_level1').val( res.data.configure_channel.money_level1 );
                        $('.money_level2').val( res.data.configure_channel.money_level2 );
                        $('.money_level3').val( res.data.configure_channel.money_level3 );
                        
                        var html = '';
                        if( res.status == 1 ){
                            console.log(res.data);return;
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.yuchong[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_yuchong').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }else if( res.status == '2' ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.yuchong[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_yuchong').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }
                    }else if(model==3){
                        $(".tongdao").show();
                        $(".daikou").hide();
            		    $(".fuwu").hide();
            		    $(".yuchong").hide();
                        $('.configure_channel_submit').attr( 'style', 'display: none' ); // 隐藏 提交按钮
                        $("input:radio[name=channel_tongdao][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                        form.render('radio');
                        //根据值让option选中 
                        $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                		layui.form.render("select");
                        $('.configure_channel_fee_tongdao').val( res.data.configure_channel.configure_channel_fee ); // 费率
                        var html = '';
                        if( res.status == 1 ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.tongdao[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }else if( res.status == '2' ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.tongdao[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }
                    }else if(model==1){
                        $(".fuwufei").show();
                        $(".daikou").hide();
            		    $(".fuwu").hide();
            		    $(".tongdao").hide();
                        $('.configure_channel_submit').attr( 'style', 'display: none' ); // 隐藏 提交按钮
                        $("input:radio[name=channel_fuwu][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                        form.render('radio');
                        //根据值让option选中 
                        $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                		layui.form.render("select");
                        $('.configure_channel_fee_fuwu').val( res.data.configure_channel.configure_channel_fee ); // 费率
                        var html = '';
                        if( res.status == 1 ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.fuwufei[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_fuwufei').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }else if( res.status == '2' ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.fuwufei[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_fuwufei').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }
                    }
                }else{
                    var model=type;
                    // console.log(model)
                    if(model==2){
                        $('.configure_channel_submit').attr( 'style', 'display: block' ); // 隐藏 提交按钮
                        $("input:radio[name=channel_daikou][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                        form.render('radio');
                        //根据值让option选中 
                        $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                		layui.form.render("select");
                        $('.configure_channel_fee_daikou').val( res.data.configure_channel.configure_channel_fee ); // 费率
                        
                        
                        var html = '';
                        if( res.status == 1 ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.daikou[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_daikou').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }else if( res.status == '2' ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.daikou[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_daikou').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }
                        $(".daikou").show();
            		    $(".tongdao").hide();
            		    $(".fuwufei").hide();
            		    $(".yuchong").hide();
                        
                    }else if(model==4){
                        
                        $(".tongdao").hide();
                        $(".daikou").hide();
            		    $(".fuwufei").hide();
            		    $(".yuchong").show();
                        $('.configure_channel_submit').attr( 'style', 'display: block' ); // 隐藏 提交按钮
                        
                        $("input:radio[name=channel][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                        form.render('radio');
                        
                        if(res.data.configure_channel.channel_radio == 1){
                            $(".channel1").show();
                            $(".channel2").hide();
                        }else{
                            $(".channel2").show();
                            $(".channel1").hide();
                        }
                        
                        
                        $('.agency_cost1').attr('value', res.data.configure_channel.users_rate.agency_cost );
                        
                        //根据值让option选中 
                        $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                		layui.form.render("select");
                        
                        $('.configure_channel_fee').val( res.data.configure_channel.configure_channel_fee ); // 费率
                        
                        $('.configure_channel_zfb').val( res.data.configure_channel.configure_channel_zfb );
                        $('.configure_channel_weixin').val( res.data.configure_channel.configure_channel_weixin );
                        $('.configure_channel_cloud').val( res.data.configure_channel.configure_channel_cloud );
                        $('.configure_channel_debit').val( res.data.configure_channel.configure_channel_debit );
                        $('.configure_channel_credit').val( res.data.configure_channel.configure_channel_credit );
                        
                        $('.money_level1').val( res.data.configure_channel.money_level1 );
                        $('.money_level2').val( res.data.configure_channel.money_level2 );
                        $('.money_level3').val( res.data.configure_channel.money_level3 );
                        
                        var html = '';
                        if( res.status == 1 ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.yuchong[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_yuchong').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }else if( res.status == '2' ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.yuchong[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_yuchong').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }
                    }else if(model==3){
                        $(".tongdao").show();
                        $(".daikou").hide();
            		    $(".fuwufei").hide();
            		    $(".yuchong").hide();
                        $('.configure_channel_submit').attr( 'style', 'display: block' ); // 隐藏 提交按钮
                        $("input:radio[name=channel_tongdao][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                        form.render('radio');
                        //根据值让option选中 
                        $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                		layui.form.render("select");
                        $('.configure_channel_fee_tongdao').val( res.data.configure_channel.configure_channel_fee ); // 费率
                        var html = '';
                        if( res.status == 1 ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.tongdao[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }else if( res.status == '2' ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.tongdao[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }
                    }else if(model==1){
                        // console.log(2)
                        $(".fuwufei").show();
                        $(".daikou").hide();
            		    $(".yuchong").hide();
            		    $(".tongdao").hide();
            		    
                        $('.configure_channel_submit').attr( 'style', 'display: block' ); // 隐藏 提交按钮
                        $("input:radio[name=channel_fuwu][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                        form.render('radio');
                        //根据值让option选中 
                        $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                		layui.form.render("select");
                        $('.configure_channel_fee_fuwu').val( res.data.configure_channel.configure_channel_fee ); // 费率
                        var html = '';
                        if( res.status == 1 ){
                            
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.fuwufei[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
                            // console.log(html)
    
                            $('.agent_level_fuwufei').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }else if( res.status == '2' ){
                            for( var i = 0; i < res.data.users_rate.length; i++ ){
                                html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.fuwufei[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                            }
    
                            $('.agent_level_fuwufei').html(html);
                            $('.configure_channel_company').attr('value', company);
                        }
                    }
                }
                
                
                
                console.log( $('#type_mode').val() )
                console.log( res.data.configure_channel.model )
                
            }, "json");
            
            
        		
        // 		if(type==1){
        // 		    $(".fuwufei").show();
        // 		    $(".yuchong").hide();
        // 		    $(".tongdao").hide();
        // 		    $(".daikou").hide();
        // 		}else if(type==2){
        // 		    $(".fuwufei").hide();
        // 		    $(".yuchong").hide();
        // 		    $(".tongdao").hide();
        // 		    $(".daikou").show();
        // 		}else if(type==3){
        // 		    $(".fuwufei").hide();
        // 		    $(".yuchong").hide();
        // 		    $(".tongdao").show();
        // 		    $(".daikou").hide();
        // 		}else if(type==4){
        // 		    $(".fuwufei").hide();
        // 		    $(".yuchong").show();
        // 		    $(".tongdao").hide();
        // 		    $(".daikou").hide();
        // 		}
        		layui.form.render("select");
    	});
        
        
        // $('.agent').html(store_name);
        $('.dbxe').val('10000');
        // $('.layui-card-header').html(agentName);
        // $('.layui-card-header').html(store_name);
        $.post("{{url('/api/user/store')}}",{
            token:token,
            store_id:store_id,
        },function(res){
            if(res.status==1){
                $('.agent').html(res.data.store_info.store_name);
                $('.layui-card-header').html(res.data.store_info.store_name);
            }else{
                $('.agent').html(store_name);
                $('.layui-card-header').html(store_name);
            }
        },"json");

        // 渲染表格
        table.render({
            elem: '#test-table-page'
            ,url: "{{url('/api/user/pay_ways_all')}}"
            ,method: 'post'
            ,where:{
                token:token
                ,store_id:store_id
            }
            ,request:{
                pageName: 'p'
                ,limitName: 'l'
            }
            // ,page: true
            ,cellMinWidth: 150
            ,cols: [[
                {field:'ways_desc', title: '通道名称'}
                ,{field:'rate', title: '结算费率',templet:'#rate'}
                ,{field:'settlement_type', title: '到账时间'}
                ,{field:'status_desc', title: '是否开通'}
                ,{field:'status',width:518,align:'center', fixed: 'right', toolbar: '#table-content-list',title: '操作',templet:'#passway'}
            ]]
            ,response: {
                statusName: 'status' //数据状态的字段名称，默认：code
                ,statusCode: 1 //成功的状态码，默认：0
                ,msgName: 'message' //状态信息的字段名称，默认：msg
                ,countName: 't' //数据总数的字段名称，默认：count
                ,dataName: 'data' //数据列表的字段名称，默认：data
            }
            ,done: function(res, curr, count){
//                console.log(res);
            $('th').css({'font-weight': 'bold', 'font-size': '15','color': 'black','background':'linear-gradient(#f2f2f2,#cfcfcf)'});	//进行表头样式设置
            }
        });

        table.on('tool(test-table-page)', function(obj){ //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
            var e = obj.data; //获得当前行数据
            var layEvent = obj.event; //获得 lay-event 对应的值（也可以是表头的 event 参数对应的值）
            var tr = obj.tr; //获得当前行 tr 的DOM对象
//            console.log(e);
            // console.log(layEvent);return;
            // localStorage.setItem('s_store_id', e.store_id);
            
            // 重置cookie有效期
            var time = Date.parse(new Date()) + (5 * 60 * 1000);
            $.session.set('time', time);
            

            if(layEvent === 'edit'){ //修改费率
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.rate').val(e.rate);
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#edit_rate')
                });
            }else if(layEvent === 'shua'){
                $('.ways').html(e.ways_desc);
                $('.types').val(e.ways_type);
                $('.rate1').val(e.rate_e);
                $('.rate2').val(e.rate_f);
                $('.rate3').val(e.rate_f_top);
                var openshua = layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#edit_shua')
                });
            }else if(layEvent === 'sub_merchant'){
                $('.way').html(e.ways_desc);
                $.post("{{url('/api/user/get_sub_merchant')}}",
                {
                    token:token
                    ,store_id:store_id
                    ,ways_type:e.ways_type
                },function(res){
                    if(res.status==1){
                        $('.wxmerchantcode').text(res.weixin_sub);
                        $('.alimerchantcode').text(res.alipay_sub);
                        layer.open({
                            type: 1,
                            title: false,
                            closeBtn: 0,
                            area: '516px',
                            skin: 'layui-layer-nobg', //没有背景色
                            shadeClose: true,
                            content: $('#sub_merchant')
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }else if(layEvent === 'newland'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                if(e.ways_source == "weixin" ){
                    $('.wx_list').show();
                }else{
                    $('.wx_list').hide();
                }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token
                    ,store_id:store_id
                    ,ways_type:e.ways_type
                    ,nl_mercId:'',
                    pass: pass,
                    path: 'api/user/open_ways_type',
                },function(res){
//                    console.log(res);
//                    console.log(res.data.nl_key);
                    if(res.status==1){
                        $('.wxmerchantda').val(res.data.nl_mercId);
                        $('.wxmerchantdb').val(res.data.nl_key);
                        $('.wxmerchantdc').val(res.data.trmNo);
                        $('.wxsubappid').val(res.data.wx_sub_appid);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#newland')
                });
            }else if(layEvent === 'open'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
        	    $('.lianfushow').hide();

                if(e.ways_source == "weixin" ){
                    $('.wx_list').show();
                }else{
                    $('.wx_list').hide();
                }

                if(e.ways_type == 2000 ){
                    $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:e.ways_type,
                        wx_sub_merchant_id:'',
                        pass: pass,
                    path: 'api/user/open_ways_type'
                    },function(res){
//                        console.log(res);
                        if(res.status==1){
                            $('.wx_sub_merchant_id').val(res.data.wx_sub_merchant_id);
                        }
                    },"json");

                    layer.open({
                        type: 1,
                        title: false,
                        closeBtn: 0,
                        area: '516px',
                        skin: 'layui-layer-nobg', //没有背景色
                        shadeClose: true,
                        content: $('#open_passway')
                    });
                }else{
                    $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:e.ways_type,
                        MerchantId:'',
                        pass: pass,
                    path: 'api/user/open_ways_type'
                    },function(res){
//                        console.log(res);
                        if(res.status==1){
                            $('.wx_sub_merchant_id').val(res.data.MerchantId);
                        }
                    },"json");

                    layer.open({
                        type: 1,
                        title: false,
                        closeBtn: 0,
                        area: '516px',
                        skin: 'layui-layer-nobg', //没有背景色
                        shadeClose: true,
                        content: $('#open_passway')
                    });
                }
            }else if(layEvent === 'openweixin'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                // if(e.ways_source == "weixin" ){
                //   $('.wx_list').show()
                // }else{
                //   $('.wx_list').hide()
                // }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                        console.log(res);
                    if(res.status==1){
                        $('.wx_sub_merchant_id_shop').val(res.data.wx_sub_merchant_id);
                        $('.wx_shop').val(res.data.wx_shop_id);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_weixin')
                });
            }else if(layEvent === 'lianfu'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                $('.lianfushow').show();

                if(e.ways_source == "weixin" ){
                    $('.wx_list').show();
                }else{
                    $('.wx_list').hide();
                }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                        console.log(res);
                    if(res.status==1){
                        $('.lianfu_sub_merchant_id').val(res.data.MerchantId);
                        $( '.icbc_type').find ("option[value=" + res.data.appid + "]" ) .attr( "selected" , true);
                        form.render('select');
                        $('.lianfukey').val(res.data.signkey);
                        $('.lianfuappid').val(res.data.appid);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_lianfu')
                });
            }else if(layEvent === 'nongjin'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                $('.nongjinkey').show();
                $('.zhongduanid').show();

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        $('.nongjin_sub_merchant_id').val(res.data.merchantNo);
                        $('.nongjinkey1').val(res.data.signkey);
                        $('.zhongduanid1').val(res.data.terminalNo);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_nongjin')
                });
            }else if(layEvent === 'gs_nongjin'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        $('.gsnongjin_merchant_id').val(res.data.MerchantId);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_gsnongjin')
                });
            }else if(layEvent === 'abc'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        $('.abc_sub_merchant_id').val(res.data.MerchantId);
                        $('.abckey').val(res.data.abckey);
                        $('.abczhongduanid').val(res.data.abczhongduanid);
                        $('.abcprivate_rsa_key').val(res.data.private_rsa_key);
                        $('.abcpublic_rsa_key').val(res.data.public_rsa_key);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_abc')
                });
            }else if(layEvent === 'abc_quiet'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        $('.abc_quiet_merchant_id').val(res.data.merchant_id);
                        $('.abc_quiet_cashier_id').val(res.data.cashier_id);
                        $('.abc_quiet_private_key').val(res.data.private_key);
                        $('.abc_quiet_public_key').val(res.data.public_key);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_abc_quiet')
                });
            }else if(layEvent === 'wingpay'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        $('.wing_institutionCode').val(res.data.institutionCode);
                        $('.wing_merchantNo').val(res.data.merchantNo);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_wingpay')
                });
            }else if(layEvent === 'cool'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        $('.cool_merchantNo').val(res.data.merchantNo);
                        $('.cool_secretkey').val(res.data.secret_key);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_cool')
                });
            }else if(layEvent === 'saobei'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        $('.saobei_zhongduan').val(res.data.zhongduan);
                        $('.saobei_merchantNo').val(res.data.merchantNo);
                        $('.saobei_token').val(res.data.access_token);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_saobei')
                });
            }else if(layEvent === 'ccb'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        $('.ccb_merchantid').val(res.data.merchantid);
                        $('.ccb_posid').val(res.data.posid);
                        $('.ccb_bankchid').val(res.data.bankchid);
                        $('.ccb_pubkey').val(res.data.pubkey);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_ccb')
                });
            }else if(layEvent === 'allinpay'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:e.ways_type,
                        pass: pass,
                    path: 'api/user/open_ways_type'
                    },function(res){
                        if(res.status==1){
                            $('.orgid').val(res.data.orgid);
                            $('.cusid').val(res.data.cusid);
                            $('.allinpay_appid').val(res.data.appid);
                            $('.allinpay_pubkey').val(res.data.pubkey);
                            $('.allinpay_prikey').val(res.data.prikey);
                        }
                    },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_allinpay')
                });
            }else if(layEvent === 'pingan'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        $('.pingan_merchant_id').val(res.data.merchant_id);
                        $('.pingan_enterpriseReg').val(res.data.enterpriseReg);
                        $('.pingan_appid').val(res.data.appid);
                        $('.pingan_appsecret').val(res.data.appsecret);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_pingan')
                });
            }else if(layEvent === 'unionpay_merch'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    wx_sub_merchant_id:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        $('#open_passway_unionpay_merch .merch_sub_merchant_id').val(res.data.MerchantId);
                        $('#open_passway_unionpay_merch .merch_appid').val(res.data.merch_appid);
                        $('#open_passway_unionpay_merch .merch_appkey').val(res.data.merch_appkey);
                        $('#open_passway_unionpay_merch .merchzhongduanid').val(res.data.merchzhongduanid);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_unionpay_merch')
                });
            }else if(layEvent === 'unionpay_merch_v2'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:e.ways_type,
                        wx_sub_merchant_id:'',
                        signkey:'',
                        pass: pass,
                        path: 'api/user/open_ways_type'
                    },function(res){
                        console.log(res)
                        if(res.status==1){
                            $('#open_passway_unionpay_merch_v2 .merch_sub_merchant_id').val(res.data.MerchantId);
                            $('#open_passway_unionpay_merch_v2 .merch_appid').val(res.data.merch_appid);
                            $('#open_passway_unionpay_merch_v2 .merch_appkey').val(res.data.merch_appkey);
                            $('#open_passway_unionpay_merch_v2 .merchzhongduanid').val(res.data.merchzhongduanid);
                        }
                    },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_unionpay_merch_v2')
                });
            }else if(layEvent === 'tf'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                if(e.ways_source == "weixin" ){
                    $('.wx_list').show();
                }else{
                    $('.wx_list').hide();
                }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    MerchantId:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        $('.tf_merchant_id').val(res.data.MerchantId);
                        $('.tfqd').val(res.data.qd);

                        if(res.data.length == 0){
                            $('.tf_show').hide();
                        }else{
                            $('.tf_show').show();
                        }

                        $('.qd_item2').html(res.data.channel_mch_id);
                        var optionStr = "";
                        $("#tf_qdopen").html('');

                        if(res.data.qd==1){
                            optionStr += "<option value=''>选择渠道</option>";
                            optionStr += "<option value='1' selected>渠道1</option>";
                            optionStr += "<option value='2'>渠道2</option>";
                        }else if(res.data.qd==2){
//                            console.log('00000');
                            optionStr += "<option value=''>选择渠道</option>";
                            optionStr += "<option value='1'>渠道1</option>";
                            optionStr += "<option value='2' selected>渠道2</option>";
                        }else if(res.data.qd==null){
//                            console.log('11111');
                            optionStr += "<option value=''>选择渠道</option>";
                            optionStr += "<option value='1'>渠道1</option>";
                            optionStr += "<option value='2'>渠道2</option>";
                        }

                        $("#tf_qdopen").append(optionStr);
                        layui.form.render('select');
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_tf_passway')
                });
            }else if(layEvent === 'hrt'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                if(e.ways_source == "weixin" ){
                    $('.wx_list').show();
                }else{
                    $('.wx_list').hide();
                }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    h_mid:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        $('.wx_sub_hrt').val(res.data.h_mid);
                    }
                },"json");
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passways')
                });
            }else if(layEvent === "ltf"){
                $('.way').html(e.ways_desc);
                $('.ltf_type').val(e.ways_type);
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    merchantCode:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        $('.ltf1').val(res.data.merchantCode);
                        $('.ltf2').val(res.data.md_key);
                        $('.ltf3').val(res.data.appId);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_ltf')
                });
            }else if(layEvent === 'dlb'){
                $('.way').html(e.ways_desc);
                $('.dlb_type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                if(e.ways_source == "weixin" ){
                    $('.wx_list').show();
                }else{
                    $('.wx_list').hide();
                }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    getdlbdata:1,
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        $('.dlb_inputs').eq(0).val(res.data.mch_num);
                        $('.dlb_inputs').eq(1).val(res.data.shop_num);
                        $('.dlb_inputs').eq(2).val(res.data.machine_num);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#dlb')
                });
            }else if(layEvent === 'sxf'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                if(e.ways_source == "weixin" ){
                    $('.wx_list').show();
                }else{
                    $('.wx_list').hide();
                }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    MerchantId:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        $('.sxf_input1').val(res.data.MerchantId);
                        $('.sxf_input2').val(res.data.wx_channel_appid);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#vbill')
                });
            }else if(layEvent === 'alipay'){
                $('.alipayway').html(e.ways_desc);
                $('.alipaytype').val(e.ways_type);

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    alipay_store_id:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        $('.wx_sub_alipay').val(res.data.alipay_store_id);
                        $('.wx_sub_alipay_wai').val(res.data.out_store_id)
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#alipay_store_id')
                });
            }else if(layEvent === 'pay'){
                $('.pay').attr('lay-href',"{{url('/user/openpassway?store_id=')}}"+store_id+"&ways_type="+e.ways_type);
            }else if(layEvent === 'alipaycode'){
                $.post("{{url('/api/user/alipay_auth')}}",
                {
                    token:token
                    ,store_id:store_id
                },function(res){
                    $('#code').html('');
                    $('#code').qrcode(res.data.qr_url);
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_alipay')
                });
            }else if(layEvent === 'js_tf'){
                $('.type').val(e.ways_type);

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_tf_js')
                });

                $("#openTf").html('');

                // 结算类型查询
                $.ajax({
                    url : "{{url('/api/basequery/settle_mode_type')}}",
                    data : {
                        token:token
                        ,ways_type:e.ways_type
                    },
                    type : 'get',
                    success : function(data) {
//                        console.log(data);
                        var optionStr = "";
                        for(var i=0;i<data.data.length;i++){
                            optionStr += "<option value='" + data.data[i].settle_mode_type + "' >"
                            + data.data[i].settle_mode_type_desc + "</option>";
                        }
                        $("#openTf").append('<option value="">请选择结算方式</option>'+optionStr);
                        layui.form.render('select');
                    },
                    error : function(data) {
                        alert('查找板块报错');
                    }
                });
                // var str = "";
                // str += "<option value='2'>"渠道2"</option>";
                // $("#qdopen").append('<option value="2">渠道2</option>');
                // layui.form.render('select');
            }else if(layEvent === 'js_hltx'){
                $('.type').val(e.ways_type);
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_hltx_js')
                });
                $("#openhltx").html('');

                // 结算类型查询
                $.ajax({
                    url : "{{url('/api/basequery/settle_mode_type')}}",
                    data : {token:token,ways_type:e.ways_type},
                    type : 'get',
                    success : function(data) {
//                        console.log(data);
                        var optionStr = "";
                        for(var i=0;i<data.data.length;i++){
                            optionStr += "<option value='" + data.data[i].settle_mode_type + "' >"
                                + data.data[i].settle_mode_type_desc + "</option>";
                        }
                        $("#openhltx").append('<option value="">请选择结算方式</option>'+optionStr);
                        layui.form.render('select');
                    },
                    error : function(data) {
                        alert('查找板块报错');
                    }
                });

                // var str = "";
                // str += "<option value='2'>"渠道2"</option>";
                // $("#qdopen").append('<option value="2">渠道2</option>');
                // layui.form.render('select');
            }else if(layEvent === 'js'){
                $('.type').val(e.ways_type);
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_js')
                });
                $("#open").html('');
                // 结算类型查询
                $.ajax({
                    url : "{{url('/api/basequery/settle_mode_type')}}",
                    data : {
                        token:token
                        ,ways_type:e.ways_type
                    },
                    type : 'get',
                    success : function(data) {
//                        console.log(data);
                        var optionStr = "";
                        for(var i=0;i<data.data.length;i++){
                            optionStr += "<option value='" + data.data[i].settle_mode_type + "' >"
                            + data.data[i].settle_mode_type_desc + "</option>";
                        }
                        $("#open").append('<option value="">请选择结算方式</option>'+optionStr);
                        layui.form.render('select');
                    },
                    error : function(data) {
                        alert('查找板块报错');
                    }
                });
            }else if(layEvent === 'sao'){
                $('.agent').html();
                $('.ways').html(e.ways_desc);
                $('.types').val(e.ways_type);
                $('.rates1').val(e.rate_a);
                $('.rates2').val(e.rate_b);
                $('.rates3').val(e.rate_b_top);
                $('.rates4').val(e.rate_c);
                $('.rates5').val(e.rate_d);
                $('.rates6').val(e.rate_d_top);
                var openshua=layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#edit_sao')
                });
            }else if(layEvent === 'floweredit'){
                var openshua=layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#edit_flower')
                });

                $('.f_box').html('');

                $.post("{{url('/api/alipayopen/store_fq_rate')}}",
                {
                    token:token,
                    store_id:store_id
                },function(res){
//                    console.log(res);
                    var html='';
                    if(res.status==1){
                        for(var i=0;i<res.data.length;i++){
                            html+='<div class="layui-form-item">';

                            if(res.data[i].status=='01'){ //开启
                                html+='<div class="f_status" style="float:left;margin-left:10px;"  data="'+res.data[i].status+'">';
                                html+='<div class="checkbox layui-unselect layui-form-checkbox layui-form-checked" lay-skin="primary" data="'+res.data[i].status+'">';
                                html+='<i class="layui-icon layui-icon-ok"></i>';
                                html+='</div>';
                                html+='</div>';
                            }else{ //关闭
                                html+='<div class="f_status" style="float:left;margin-left:10px;"  data="'+res.data[i].status+'">';
                                html+='<div class="checkbox layui-unselect layui-form-checkbox" lay-skin="primary" data="'+res.data[i].status+'">';
                                html+='<i class="layui-icon layui-icon-ok"></i>';
                                html+='</div>';
                                html+='</div>';
                            }

                            html+='<label class="layui-form-label">'+res.data[i].num+'期费率:</label>';
                            html+='<div class="layui-input-block f_block" data="'+res.data[i].num+'">';
                            html+='<input type="text" placeholder="请输入'+res.data[i].num+'期费率" class="layui-input f_inputs" value="'+res.data[i].rate+'">%';
                            html+='</div>';
                            html+='<button class="layui-btn open_f_save">确定</button>';
                            html+='</div>';
                        }

                        $('.f_box').append(html);
                    }
                },"json");
            }else if(layEvent === 'delpassway'){
                layer.confirm('确认清除此通道?',{icon: 2}, function(index){
                    $.post("{{url('/api/user/clear_ways_type')}}",
                    {
                        token:token
                        ,company:e.company
                        ,store_id:store_id
                    },function(res){
//                        console.log(res);
                        if(res.status==1){
                            obj.del(); //删除对应行（tr）的DOM结构，并更新缓存
                            layer.close(index);
                            layer.msg(res.message, {
                                offset: '50px'
                                ,icon: 1
                                ,time: 2000
                            });
                        }else{
                            layer.msg(res.message, {
                                offset: '50px'
                                ,icon: 2
                                ,time: 3000
                            });
                        }
                    },"json");
                });
            }else if(layEvent === 'passwaydisable'){
                $('.passway_ways_type').val(e.ways_type);
                $('.passway_company').val(e.company);
                $.post("{{url('/api/user/store_ways_select')}}",
                {
                    token:token
                    ,store_id:store_id
                    ,ways_type:e.ways_type
                    ,company:e.company
                },function(res){
//                        console.log(res);
                    if(res.status==1){
                        if(res.data.length!=0){
                            $('.passway_ways_type').val(res.data.ways_type);
                            $('.passway_company').val(res.data.company);
                            $('.passway1').val(res.data.is_close);
                            $('.passway2').val(res.data.pcredit);
                            $('.passway3').val(res.data.credit);
                            $('.dbxe').val(res.data.pay_amount_e);

                            // 第一个
                            $("#passway1").html('');
                            var optionStr1 = "";
                            if(res.data.is_close==0){
                                optionStr1 += "<option value='0' selected>开启</option>";
                                optionStr1 += "<option value='1'>关闭</option>";
                            }else{
                                optionStr1 += "<option value='0'>开启</option>";
                                optionStr1 += "<option value='1' selected>关闭</option>";
                            }

                            $("#passway1").append(optionStr1);
                            layui.form.render('select');

                            // 第二个
                            $("#passway2").html('');
                            var optionStr2 = "";
                            if(res.data.pcredit=="01"){
                                optionStr2 += "<option value='01' selected>开启</option>";
                                optionStr2 += "<option value='00'>关闭</option>";
                            }else{
                                optionStr2 += "<option value='01'>开启</option>";
                                optionStr2 += "<option value='00' selected>关闭</option>";
                            }

                            $("#passway2").append(optionStr2);
                            layui.form.render('select');

                            // 第三个
                            $("#passway3").html('');
                            var optionStr3 = "";
                            if(res.data.credit=="01"){
                                optionStr3 += "<option value='01' selected>开启</option>";
                                optionStr3 += "<option value='00'>关闭</option>";
                            }else{
                                optionStr3 += "<option value='01'>开启</option>";
                                optionStr3 += "<option value='00' selected>关闭</option>";
                            }

                            $("#passway3").append(optionStr3);
                            layui.form.render('select');
                        }
                    }
                },"json");

                var openshua=layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_disable')
                });
            }else if(layEvent === 'hltx'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                // $('.lianfushow').hide()

                if(e.ways_source == "weixin" ){
                    $('.wx_list').show();
                }else{
                    $('.wx_list').hide();
                }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    MerchantId:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                        console.log(res);
                    if(res.status==1){
                        $('.hltx_wx_sub_merchant_id').val(res.data.MerchantId);
//                            console.log(e.ways_type);
//                            console.log(res.data.ali_merchant_no);
                        if(e.ways_type===23001){
                            $('.waynum').html(res.data.ali_merchant_no);
                        }else if(e.ways_type===23002){
                            $('.waynum').html(res.data.wx_merchant_no);
                        }else if(e.ways_type===23004){
                            $('.waynum').html(res.data.union_merchant_no);
                        }

                        $('.hltxqd').val(res.data.qd);
                        $("#hltx_qdopen_td").html('');

                        var optionStr = "";
                        if(res.data.qd==1){
                            optionStr += "<option value=''>选择渠道</option>";
                            optionStr += "<option value='1' selected>渠道1</option>";
                            optionStr += "<option value='2'>渠道2</option>";
                        }else if(res.data.qd==2){
//                                console.log('00000');
                            optionStr += "<option value=''>选择渠道</option>";
                            optionStr += "<option value='1'>渠道1</option>";
                            optionStr += "<option value='2' selected>渠道2</option>";
                        }else if(res.data.qd==null){
//                                console.log('11111');
                            optionStr += "<option value=''>选择渠道</option>";
                            optionStr += "<option value='1'>渠道1</option>";
                            optionStr += "<option value='2'>渠道2</option>";
                        }

                        $("#hltx_qdopen_td").append(optionStr);
                        layui.form.render('select');
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#hltx_passway')
                });
            }else if(layEvent === 'changsha'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                // $('.lianfushow').hide()

                if(e.ways_source == "weixin" ){
                    $('.changsha_list').show();
                }else{
                    $('.changsha_list').hide();
                }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    MerchantId:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        $('.changsha_wx_sub_merchant_id').val(res.data.MerchantId);
                        $('.store_num').val(res.data.DeptId);
                        $('.merchant_num').val(res.data.StaffId);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#changsha_passway')
                });
            }else if(layEvent === 'lianfuyoupay'){
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);
                // $('.lianfushow').hide()

                if(e.ways_source == "weixin" ){
                    $('.lianfuyoupay_list').show();
                }else{
                    $('.lianfuyoupay_list').hide();
                }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:e.ways_type,
                    MerchantId:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                        console.log(res);
                    if(res.status==1){
                        $('.lianfuyoupay_merchant_id').val(res.data.MerchantId);
                        $('.lianfuyoupaykey').val('000000');
                        $('.pos_sn').val('000000');
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#lianfuyoupay_passway')
                });
            }else if(layEvent === 'huipay'){ //获取商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                $.post("{{url('/api/user/get_mer_id')}}",
                {
                    token:token
                    ,store_id:store_id
                    ,ways_type:e.ways_type
                },function(res){
//                      console.log(res);
                    if(res.status==1){
                        $('.huipay_merchant_id').val(res.data.mer_id);
                        $('.huipay_inputs').val(res.data.device_id);
                        //$('.huipay_merchant_id').html(res.data.mer_id);
                        //$('.huipay_inputs').html(res.data.device_id);
//                          console.log(typeof(res.data.length));
                        if(res.data.length == 0){
                            $('.huipay_show').hide();
                        }else{
                            $('.huipay_show').show();
                        }
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_huipay_passway')
                });
            }else if (layEvent === 'openweixina') { //官方微信a
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $('.ways_source').val(e.ways_source);

                //发送请求
                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: e.ways_type,
                    wx_sub_merchant_id: '',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                }, function(res) {
                    console.log
                    if (res.status == 1) {
                        layui.use('form', function() {
                            var form = layui.form;

                            //商户号输入框赋值
                            $('.wxa_sub_merchant_id_shop').val(res.data.wx_sub_merchant_id);

                            //优惠商品ID输入框赋值
                            $('.wxa_shop').val(res.data.wx_shop_id);

                            form.render(); //更新全部
                        });
                    }
                }, "json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_passway_weixina')
                });
            } else if (layEvent === 'wftpay') { //威富通-获取商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type'
                }, function(res) {
                    if (res.status == 1) {
                        $('.wftpay_mch_id').val(res.data.wftpayMchId);
                    }
                }, "json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_wftpay_passway')
                });
            } else if (layEvent === 'cib') { //兴业银行-获取商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type'
                }, function(res) {
                    if (res.status == 1) {
                        $('.cib_mch_id').val(res.data.cibMchId);
                    }
                }, "json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_cib_passway')
                });
            } else if (layEvent === 'cqcbank') { //重庆银行-获取商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type'
                }, function(res) {
                    if (res.status == 1) {
                        $('.cqcbank_mch_id').val(res.data.mch_id);
                    }
                }, "json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_cqcbank_passway')
                });
            } else if (layEvent === 'hwcpay') { //汇旺财-获取商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type'
                }, function(res) {
                    if (res.status == 1) {
                        $('.hwcpay_mch_id').val(res.data.hwcpayMchId);
                        $('.hwcpay_merchant_num').val(res.data.hwcpayMerchantNum);
                    }
                }, "json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_hwcpay_passway')
                });
            } else if (layEvent === 'yinka') { //银卡-获取商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type'
                }, function(res) {
                    if (res.status == 1) {
                        $('.yinka_unique_id').val(res.data.yinka_unique_id);
                        $('.yinka_sn').val(res.data.yinka_sn);
                        $('.yinka_id').val(res.data.yinka_id);
                        $('.yinka_key').val(res.data.yinka_key);
                         $('.yinka_pri_key').val(res.data.yinka_pri_key);
                    }
                }, "json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_yinka_passway')
                });
            } else if (layEvent === 'cmbc') { //民生-获取商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type'
                }, function(res) {
                    if (res.status == 1) {
                        $('.cmbc_mch_id').val(res.data.cmbc_mch_id);
                        $('.cmbc_private_key').val(res.data.cmbc_private_key);
                    }
                }, "json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_cmbc_passway')
                });
            }else if (layEvent === 'yinsheng') { //银卡-获取商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);
                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type'
                }, function(res) {
                    if (res.status == 1) {
                        $('.yinsheng_seller_id').val(res.data.yinsheng_seller_id);
                    }
                }, "json");
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_yinsheng_passway')
                });

            } else if(layEvent === 'easypay'){ //获取商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token
                    ,store_id:store_id
                    ,ways_type:e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                      console.log(res);
                    if(res.status==1){
                        $('.easypay_mercode').val(res.data.easyPayMerCode);
                        $('.easypay_termcode').val(res.data.easyPayTermCode);
                        $('.easypay_operatrace').val(res.data.operaTrace);
                         $('.easypay_private_key').val(res.data.easyPrivateKey);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_easypay_passway')
                });
            }else if(layEvent === 'linkage'){ //联动优势商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                if(e.ways_source == "weixin" ){
                    $('.wx_list').show();
                }else{
                    $('.wx_list').hide();
                }

                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token
                    ,store_id:store_id
                    ,ways_type:e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status == 1){
                        $('.linkageAcqMerId').val(res.data.acqMerId);
                        $('.linkageSubAppid').val(res.data.subAppid);
                        $('.linkageSubMchId').val(res.data.subMchId);
                        $('.linkageMerId').val(res.data.merId);
                    }
                },"json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_linkage_passway')
                });
            }else if(layEvent === 'jiujiang'){ // 九江银行商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token
                    ,store_id: store_id
                    ,ways_type: e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type',
                }, function(res){
                    if(res.status == 1){
                        $('.jiujiang_mchtNo').val(res.data.mchtNo);
                        $('.jiujiang_termNo').val(res.data.termNo);
                        $('.jiujiang_private_key').val(res.data.private_key);
                    }
                }, "json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_jiujiang_passway')
                });
            }else if(layEvent === 'dongguan'){ // 东莞银行商户号
                $('.way').html(e.ways_desc);
                $('.type').val(e.ways_type);

                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token
                    ,store_id: store_id
                    ,ways_type: e.ways_type,
                    pass: pass,
                    path: 'api/user/open_ways_type',
                }, function(res){
                    if(res.status == 1){
                        $('.dongguan_mchtNo').val(res.data.dongguan_mchtNo);
                        $('.dongguan_termNo').val(res.data.dongguan_termNo);
                        $('.dongguan_private_key').val(res.data.dongguan_private_key);
                    }
                }, "json");

                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#open_dongguan_passway')
                });
            }else if(layEvent === 'check_results'){
                // console.log(2)
                // $('.check_results').click(function() {
                //     console.log(3)
                
                $.post("{{url('/api/glow/check_results')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: $('.type').val(),
                    ls_merchant_id: $('.ls_merchant_id').val(),
                    ls_service_provider: $('.ls_service_provider').val(),
                    ls_key: $('.ls_key').val(),
                }, function(res) {
                    if (res.status == 1) {
                        layer.msg(res.message, {
                            offset: '50px',
                            icon: 1,
                            time: 1000
                        }, function() {
                            window.location.reload();
                        });
                    } else {
                        layer.msg(res.message, {
                            offset: '50px',
                            icon: 2,
                            time: 3000
                        }, function() {
                            window.location.reload();
                        });
                    }
                }, "json");
                // });
            }else if(layEvent === 'vbill_del'){
                var company=e.company;
                layer.confirm('确定清除通道吗?',{icon: 2}, function(index){
                    $.post("{{url('/api/glow/vbill_del')}}", {
                        token: token,
                        store_id: store_id,
                        company: company,
                        pass: pass,
                    }, function(res) {
                        if (res.status == 1) {
                            layer.msg(res.message, {
                                offset: '50px',
                                icon: 1,
                                time: 1000
                            }, function() {
                                window.location.reload();
                            });
                        } else {
                            layer.msg(res.message, {
                                offset: '50px',
                                icon: 2,
                                time: 3000
                            }, function() {
                                window.location.reload();
                            });
                        }
                    }, "json");
                });
            }else if(layEvent === 'check_linkage_results'){
                // console.log(2)
                // $('.check_linkage_results').click(function() {
                //     console.log(3)
                    $.post("{{url('/api/glow/check_linkage_results')}}", {
                        token: token,
                        store_id: store_id,
                        ways_type: $('.type').val(),
                        ls_merchant_id: $('.ls_merchant_id').val(),
                        ls_service_provider: $('.ls_service_provider').val(),
                        ls_key: $('.ls_key').val(),
                    }, function(res) {
                        if (res.status == 1) {
                            layer.msg(res.message, {
                                offset: '50px',
                                icon: 1,
                                time: 1000
                            }, function() {
                                window.location.reload();
                            });
                        } else {
                            layer.msg(res.message, {
                                offset: '50px',
                                icon: 2,
                                time: 3000
                            }, function() {
                                window.location.reload();
                            });
                        }
                    }, "json");
                // });
            }else if(layEvent === 'check_wingpay_results'){
                    $.post("{{url('/api/glow/check_wingpay_results')}}", {
                        token: token,
                        store_id: store_id,
                        ways_type: $('.type').val(),
                        ls_merchant_id: $('.ls_merchant_id').val(),
                        ls_service_provider: $('.ls_service_provider').val(),
                        ls_key: $('.ls_key').val(),
                    }, function(res) {
                        if (res.status == 1) {
                            layer.msg(res.message, {
                                offset: '50px',
                                icon: 1,
                                time: 1000
                            }, function() {
                                window.location.reload();
                            });
                        } else {
                            layer.msg(res.message, {
                                offset: '50px',
                                icon: 2,
                                time: 3000
                            }, function() {
                                window.location.reload();
                            });
                        }
                    }, "json");
                // });
                
            }else if(layEvent === 'check_yinsheng_results'){
                $.post("{{url('/api/glow/check_yinsheng_results')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: $('.type').val(),
                }, function(res) {
                  if (res.status === 1) {
                      $('#code').html('');
                      $('#code').qrcode(res.data.url);
                      $('#open_alipay > :first').html('进件查询');
                      $('#open_alipay > .layui-card-body :first').html('扫码签约');

                      layer.open({
                          type: 1,
                          title: false,
                          closeBtn: 0,
                          area: '516px',
                          skin: 'layui-layer-nobg', //没有背景色
                          shadeClose: true,
                          content: $('#open_alipay')
                      });
                  } else {
                      layer.msg(res.message, {
                          offset: '50px',
                          icon: 1,
                          time: 1000
                      }, function() {
                          window.location.reload();
                      });
                  }

                }, "json");
                
            }else if(layEvent === 'check_cha_results'){
                    layer.msg('当前通道进件查询功能未接入', {
                        offset: '50px',
                        icon: 2,
                        time: 3000
                    }, function() {
                        
                    });
            }else if(layEvent === 'configure_channel'){
                $('.way').html(e.ways_desc);
                $.post("{{url('/api/glow/agent_level')}}", {
                    token: token,
                    store_id: store_id,
                    company: e.company,
                    model: 4
                }, function(res){
                    // console.log( $('.model').val() )
                    // console.log( res.data.configure_channel.model )
                    
                    if( res.status == '2' ){
                        var model = res.data.configure_channel.model;
                        
                        if(model==2){
                		    $(".daikou").show();
                		    $(".tongdao").hide();
                		    $(".fuwufei").hide();
                		    $(".yuchong").hide();
                            $('.configure_channel_submit').attr( 'style', 'display: none' ); // 隐藏 提交按钮
                            $("input:radio[name=channel_daikou][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                            form.render('radio');
                            //根据值让option选中 
                            $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                    		layui.form.render("select");
                            $('.configure_channel_fee_daikou').val( res.data.configure_channel.configure_channel_fee ); // 费率
                            
                            var html = '';
                            if( res.status == 1 ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.daikou[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_daikou').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }else if( res.status == '2' ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.daikou[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_daikou').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }
                            
                        }else if(model==4){
                            $(".tongdao").hide();
                            $(".daikou").hide();
                		    $(".fuwufei").hide();
                		    $(".yuchong").show();
                            $('.configure_channel_submit').attr( 'style', 'display: none' ); // 隐藏 提交按钮
                            
                            $("input:radio[name=channel][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                            form.render('radio');
                            
                            if(res.data.configure_channel.channel_radio == 1){
                                $(".channel1").show();
                                $(".channel2").hide();
                            }else{
                                $(".channel2").show();
                                $(".channel1").hide();
                            }
                            
                            
                            $('.agency_cost1').attr('value', res.data.configure_channel.users_rate.agency_cost );
                            
                            //根据值让option选中 
                            $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                            $("#type_mode").attr("disabled", "disabled");
                            // $("#openhltx").hide();
                    		layui.form.render("select");
                            
                            $('.configure_channel_fee').val( res.data.configure_channel.configure_channel_fee ); // 费率
                            
                            $('.configure_channel_zfb').val( res.data.configure_channel.configure_channel_zfb );
                            $('.configure_channel_weixin').val( res.data.configure_channel.configure_channel_weixin );
                            $('.configure_channel_cloud').val( res.data.configure_channel.configure_channel_cloud );
                            $('.configure_channel_debit').val( res.data.configure_channel.configure_channel_debit );
                            $('.configure_channel_credit').val( res.data.configure_channel.configure_channel_credit );
                            
                            $('.money_level1').val( res.data.configure_channel.money_level1 );
                            $('.money_level2').val( res.data.configure_channel.money_level2 );
                            $('.money_level3').val( res.data.configure_channel.money_level3 );
                            // console.log(2)
                            var html = '';
                            if( res.status == 1 ){
                                console.log(res.data);return;
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.yuchong[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_yuchong').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }else if( res.status == '2' ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.yuchong[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_yuchong').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }
                            // console.log(html)
                        }else if(model==3){
                            $(".tongdao").show();
                            $(".daikou").hide();
                		    $(".fuwufei").hide();
                		    $(".yuchong").hide();
                            $('.configure_channel_submit').attr( 'style', 'display: none' ); // 隐藏 提交按钮
                            $("input:radio[name=channel_tongdao][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                            form.render('radio');
                            //根据值让option选中 
                            $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                    		layui.form.render("select");
                            $('.configure_channel_fee_tongdao').val( res.data.configure_channel.configure_channel_fee ); // 费率
                            var html = '';
                            if( res.status == 1 ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.tongdao[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_yuchong').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }else if( res.status == '2' ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.tongdao[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }
                        }else if(model==1){
                            $(".fuwufei").show();
                            $(".daikou").hide();
                		    $(".yuchong").hide();
                		    $(".tongdao").hide();
                            $('.configure_channel_submit').attr( 'style', 'display: none' ); // 隐藏 提交按钮
                            $("input:radio[name=channel_fuwu][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                            form.render('radio');
                            //根据值让option选中 
                            $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                    		layui.form.render("select");
                            $('.configure_channel_fee_fuwu').val( res.data.configure_channel.configure_channel_fee ); // 费率
                            var html = '';
                            // console.log(2)
                            if( res.status == 1 ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.fuwufei[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_fuwufei').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }else if( res.status == '2' ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.fuwufei[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_fuwufei').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }
                        }
                        
                        $("#type_mode").attr("disabled", "disabled");
                        
                        $(".configure_channel_fee").attr("disabled", "disabled");
                        $(".money_level1").attr("disabled", "disabled");
                        $(".money_level2").attr("disabled", "disabled");
                        $(".money_level3").attr("disabled", "disabled");
                        $(".channel_radio").attr("disabled", "disabled");
                        $(".configure_channel_fee_fuwu").attr("disabled", "disabled");
                        $(".configure_channel_fee_tongdao").attr("disabled", "disabled");
                        $(".configure_channel_fee_daikou").attr("disabled", "disabled");
                        
                		layui.form.render("select");
                		
                // 		$(".channel_radio").attr("disabled", "disabled");
                // 		layui.form.render("select");
                		
                		
                		
                    }else{
                        // console.log(2)
                        var model=res.data.configure_channel.model;
                        if(model==2){
                            $('.configure_channel_submit').attr( 'style', 'display: block' ); // 隐藏 提交按钮
                            $("input:radio[name=channel_daikou][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                            form.render('radio');
                            //根据值让option选中 
                            // $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                            $("#type_mode").val(res.data.configure_channel.model);
                    		layui.form.render("select");
                            $('.configure_channel_fee_daikou').val( res.data.configure_channel.configure_channel_fee ); // 费率
                            
                            var html = '';
                            if( res.status == 1 ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.daikou[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_daikou').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }else if( res.status == '2' ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.daikou[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_daikou').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }
                            $(".daikou").hide();
                		    $(".tongdao").hide();
                		    $(".fuwufei").hide();
                		    $(".yuchong").hide();
                            
                        }else if(model==4){
                            $(".tongdao").hide();
                            $(".daikou").hide();
                		    $(".fuwufei").hide();
                		    $(".yuchong").show();
                            $('.configure_channel_submit').attr( 'style', 'display: block' ); // 隐藏 提交按钮
                            
                            $("input:radio[name=channel][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                            form.render('radio');
                            // console.log($("input:radio[name=channel][value="+ res.data.configure_channel.channel_radio +"]"))
                            
                            if(res.data.configure_channel.channel_radio == 1){
                                $(".channel1").show();
                                $(".channel2").hide();
                            }else{
                                $(".channel2").show();
                                $(".channel1").hide();
                            }
                            
                            
                            $('.agency_cost1').attr('value', res.data.configure_channel.users_rate.agency_cost );
                            
                            // console.log( $('#type_mode').val() )
                            // console.log( res.data.configure_channel.model )
                            
                            //根据值让option选中 
                            // $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                            $("#type_mode").val(res.data.configure_channel.model);
                    		layui.form.render("select");
                    	    
                    // 		console.log( $('#type_mode').val() )
                    //         console.log( res.data.configure_channel.model )
                            
                            $('.configure_channel_fee').val( res.data.configure_channel.configure_channel_fee ); // 费率
                            
                            $('.configure_channel_zfb').val( res.data.configure_channel.configure_channel_zfb );
                            $('.configure_channel_weixin').val( res.data.configure_channel.configure_channel_weixin );
                            $('.configure_channel_cloud').val( res.data.configure_channel.configure_channel_cloud );
                            $('.configure_channel_debit').val( res.data.configure_channel.configure_channel_debit );
                            $('.configure_channel_credit').val( res.data.configure_channel.configure_channel_credit );
                            
                            $('.money_level1').val( res.data.configure_channel.money_level1 );
                            $('.money_level2').val( res.data.configure_channel.money_level2 );
                            $('.money_level3').val( res.data.configure_channel.money_level3 );
                            
                            var html = '';
                            if( res.status == 1 ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.yuchong[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_yuchong').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }else if( res.status == '2' ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.yuchong[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_yuchong').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }
                        }else if(model==3){
                            $(".tongdao").hide();
                            $(".daikou").hide();
                		    $(".fuwufei").hide();
                		    $(".yuchong").hide();
                            $('.configure_channel_submit').attr( 'style', 'display: block' ); // 隐藏 提交按钮
                            $("input:radio[name=channel_tongdao][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                            form.render('radio');
                            //根据值让option选中 
                            // $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                            $("#type_mode").val(res.data.configure_channel.model);
                    		layui.form.render("select");
                            $('.configure_channel_fee_tongdao').val( res.data.configure_channel.configure_channel_fee ); // 费率
                            var html = '';
                            if( res.status == 1 ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.tongdao[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_yuchong').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }else if( res.status == '2' ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.tongdao[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }
                        }else if(model==1){
                            $(".fuwufei").hide();
                            $(".daikou").hide();
                		    $(".fuwufei").hide();
                		    $(".tongdao").hide();
                            $('.configure_channel_submit').attr( 'style', 'display: block' ); // 隐藏 提交按钮
                            $("input:radio[name=channel_fuwu][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                            form.render('radio');
                            //根据值让option选中 
                            // $("#type_mode option[value='" + res.data.configure_channel.model + "']").attr("selected", "selected");
                            $("#type_mode").val(res.data.configure_channel.model);
                    		layui.form.render("select");
                            $('.configure_channel_fee_fuwu').val( res.data.configure_channel.configure_channel_fee ); // 费率
                            var html = '';
                            if( res.status == 1 ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.fuwufei[i].agency_cost + '"  type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_yuchong').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }else if( res.status == '2' ){
                                for( var i = 0; i < res.data.users_rate.length; i++ ){
                                    html += '<div class="layui-form-item" style="margin-bottom: 0"><label class="layui-form-label" style="width: 40%">' + (i+1) + '级代理成本:<br/>(' + res.data.users_rate[i].name + ')</label>';
                                    html += '<input type="hidden" style="display: none;" class="agent_id'+ (i+1) +'" value="' + res.data.users_rate[i].id + '">';
                                    html += '<div class="layui-input-block" style="margin-left: 50%;"><input disabled value="' + res.data.configure_channel.fuwufei[i].agency_cost + '" type="number" placeholder="请输入' + (i+1) + '级代理成本" class="layui-input agency_cost' + (i+1) + '"></div></div>';
                                }
        
                                $('.agent_level_fuwufei').html(html);
                                $('.configure_channel_company').attr('value', e.company);
                            }
                        }
                        
                        // console.log( $('#type_mode').val() )
                        // console.log( res.data.configure_channel.model )
                        
                        $("#type_mode").removeAttr("disabled");
                        
                        $(".configure_channel_fee").removeAttr("disabled");
                        $(".money_level1").removeAttr("disabled");
                        $(".money_level2").removeAttr("disabled");
                        $(".money_level3").removeAttr("disabled");
                        $(".channel_radio").removeAttr("disabled");
                        $(".configure_channel_fee_fuwu").removeAttr("disabled");
                        $(".configure_channel_fee_tongdao").removeAttr("disabled");
                        $(".configure_channel_fee_daikou").removeAttr("disabled");
                        
                        $("input:radio[name=channel_fuwu][value="+ res.data.configure_channel.channel_radio +"]").attr("checked", "true"); // 赋值单选框
                        form.render('radio');
                        
                        layui.form.render('select');
                        
                        // $("input[type=radio][name='channel_radio']").attr("disabled", false);//点选功能生效
                        // $("input[type=radio][name='channel_radio']").next().removeClass('layui-radio-disabled');//显示功能生效
                        
                        
                        
                    }
                    // console.log(html)
                }, "json");
                
        //         $("#type_mode option[value='" + 2 + "']").attr("selected", "selected");
        // 		layui.form.render("select");
                // $("#type_mode").val(2);
                // layui.form.render('select');
        		
        // 		console.log( $("#type_mode").val() )
                
                layer.open({
                    type: 1,
                    title: false,
                    closeBtn: 0,
                    area: '516px',
                    skin: 'layui-layer-nobg', //没有背景色
                    shadeClose: true,
                    content: $('#configure_channel')
                });
            }

        });

        $('.f_box').on('click','.checkbox',function(){
//            console.log($(this).attr('data'));
//            console.log($(this).hasClass('layui-form-checked'));
            if($(this).hasClass('layui-form-checked') == false){
                $(this).addClass("layui-form-checked");
                $(this).attr('data',"01");
                $(this).parent().attr('data',"01");
            } else {
                $(this).removeClass("layui-form-checked");
                $(this).attr('data',"00");
                $(this).parent().attr('data',"00");
            }
        });

        form.on('select(open)', function(data){
            category = data.value;
            categoryName = data.elem[data.elem.selectedIndex].text;
            $('.js').val(category);
        });
        
        form.on('select(you_type)', function(data){
            category = data.value;
            categoryName = data.elem[data.elem.selectedIndex].text;
            $('.you_type').val(category);
        });
        
         form.on('select(icbc_type)', function(data){
            category = data.value;
            categoryName = data.elem[data.elem.selectedIndex].text;
            $('.icbc_type').val(category);
        });

        form.on('select(openTf)', function(data){
            category = data.value;
            categoryName = data.elem[data.elem.selectedIndex].text;
            $('.js_open_tf').val(category);
        });

        form.on('select(tf_qdopen)', function(data){
            category = data.value;
            // categoryName = data.elem[data.elem.selectedIndex].text;
            $('.tfqd').val(category);
        });

        form.on('select(openhltx)', function(data){
            category = data.value;
            categoryName = data.elem[data.elem.selectedIndex].text;
            $('.js_open_tf').val(category);
        });

        form.on('select(qdopen)', function(data){
            category = data.value;
            categoryName = data.elem[data.elem.selectedIndex].text;
            $('.qd').val(category);
        });

        // HL通道  2020.7.1**********
        form.on('select(hltx_qdopen)', function(data){
            category = data.value;
            // categoryName = data.elem[data.elem.selectedIndex].text;
            $('.hltxqd').val(category);
        });

        form.on('select(hltx_qdopen_td)', function(data){
            category = data.value;
            // categoryName = data.elem[data.elem.selectedIndex].text;
            $('.hltxqd').val(category);
        });
        // HL通道**********

        // 2020.06.15
        form.on('select(passway1)', function(data){
            val = data.value;
            valname = data.elem[data.elem.selectedIndex].text;
            $('.passway1').val(val);
        });

        form.on('select(passway2)', function(data){
            val = data.value;
            valname = data.elem[data.elem.selectedIndex].text;
            $('.passway2').val(val);
        });

        form.on('select(passway3)', function(data){
            val = data.value;
            valname = data.elem[data.elem.selectedIndex].text;
            $('.passway3').val(val);
        });

        $('.save_display').click(function(){
            $.post("{{url('/api/user/store_ways_set')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.passway_ways_type').val(),
                    company:$('.passway_company').val(),
                    is_close:$('.passway1').val(),
                    pcredit:$('.passway2').val(),
                    credit:$('.passway3').val(),
                    pay_amount_e:$('.dbxe').val()
                },function(res){
                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 2000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");

        });

        // 修改费率
        $('.submit').click(function(){
            
            // 重置cookie有效期
            var time = Date.parse(new Date()) + (5 * 60 * 1000);
            $.session.set('time', time);
            var pass =$.session.get('pass');
            
            $.post("{{url('/api/user/edit_store_rate_pc')}}",
            {
                token:token,
                store_id:store_id,
                ways_type:$('.type').val(),
                rate:$('.rate').val(),
                pass: pass,
                path: 'api/user/open_ways_type',
            },function(res){
//                console.log(res);
                if(res.status==1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 2000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            },"json");
            $('#edit_rate').css('display','none')
        });

        $('.submits').click(function(){
            $.post("{{url('/api/user/edit_store_un_rate')}}",
            {
                token:token,
                store_id:store_id,
                ways_type:$('.types').val(),
                rate_e:$('.rate1').val(),
                rate_f:$('.rate2').val(),
                rate_f_top:$('.rate3').val()
            },function(res){
//                console.log(res);
                if(res.status==1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 1000
                    });
                }
            },"json");
        });

        $('.submitsao').click(function(){
            $.post("{{url('/api/user/edit_store_unqr_rate')}}",
            {
                token:token,
                store_id:store_id,
                ways_type:$('.types').val(),
                rate_a:$('.rates1').val(),
                rate_b:$('.rates2').val(),
                rate_b_top:$('.rates3').val(),
                rate_c:$('.rates4').val(),
                rate_d:$('.rates5').val(),
                rate_d_top:$('.rates6').val()
            },function(res){
//                console.log(res);
                if(res.status==1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 1000
                    });
                }
            },"json");
        });

        $('.save_newland').click(function(){
            if($('.ways_source').val() == 'weixin'){
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    nl_mercId:$('.wxmerchantda').val(),
                    nl_key:$('.wxmerchantdb').val(),
                    trmNo:$('.wxmerchantdc').val(),
                    weixin_path:$('.wx_path_newland').val(),
                    wx_sub_appid:$('.wxsubappid').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 2000
                        }/*,function(){
                        window.location.reload();
                        }*/);
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }else{
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    nl_mercId:$('.wxmerchantda').val(),
                    nl_key:$('.wxmerchantdb').val(),
                    trmNo:$('.wxmerchantdc').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 2000
                        }/*,function(){
                        window.location.reload();
                        }*/);
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }
        });

        // 开通通道
        $('.open_way').click(function(){
//            console.log($('.ways_source').val());
            if($('.ways_source').val()=='weixin'){
                if($('.type').val() == 2000){
                    $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:$('.type').val(),
                        wx_sub_merchant_id:$('.wx_sub_merchant_id').val(),
                        weixin_path:$('.wx_path').val(),
                        pass: pass,
                    path: 'api/user/open_ways_type'
                    },function(res){
//                        console.log(res);
                        if(res.status==1){
                            layer.msg(res.message, {
                                offset: '50px'
                                ,icon: 1
                                ,time: 1000
                            },function(){
                                window.location.reload();
                            });
                        }else{
                            layer.msg(res.message, {
                                offset: '50px'
                                ,icon: 2
                                ,time: 3000
                            });
                        }
                    },"json");
                }else{
                    $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:$('.type').val(),
                        MerchantId:$('.wx_sub_merchant_id').val(),
                        weixin_path:$('.wx_path').val(),
                        pass: pass,
                    path: 'api/user/open_ways_type'
                    },function(res){
//                        console.log(res);
                        if(res.status==1){
                            layer.msg(res.message, {
                                offset: '50px'
                                ,icon: 1
                                ,time: 1000
                            },function(){
                                window.location.reload();
                            });
                        }else{
                            layer.msg(res.message, {
                                offset: '50px'
                                ,icon: 2
                                ,time: 3000
                            });
                        }
                    },"json");
                }
            }else{
                if($('.type').val() == 2000){
                    $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:$('.type').val(),
                        wx_sub_merchant_id:$('.wx_sub_merchant_id').val(),
                        pass: pass,
                    path: 'api/user/open_ways_type'
                    },function(res){
//                        console.log(res);
                        if(res.status==1){
                            layer.msg(res.message, {
                                offset: '50px'
                                ,icon: 1
                                ,time: 1000
                            },function(){
                                window.location.reload();
                            });
                        }else{
                            layer.msg(res.message, {
                                offset: '50px'
                                ,icon: 2
                                ,time: 3000
                            });
                        }
                    },"json");
                }else{
                    $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:$('.type').val(),
                        MerchantId:$('.wx_sub_merchant_id').val()
                    },function(res){
//                        console.log(res);
                        if(res.status==1){
                            layer.msg(res.message, {
                                offset: '50px'
                                ,icon: 1
                                ,time: 1000
                            },function(){
                                window.location.reload();
                            });
                        }else{
                            layer.msg(res.message, {
                                offset: '50px'
                                ,icon: 2
                                ,time: 3000
                            });
                        }
                    },"json");
                }
            }
        });

        // 开通葫芦天下通道
        $('.hltx_way').click(function(){
            console.log($('.ways_source').val(),$('.type').val())
            if($('.ways_source').val()=='weixin'){
                if($('.type').val() == 2000){
                    $.post("{{url('/api/user/open_ways_type')}}",
                        {
                            token:token,
                            store_id:store_id,
                            ways_type:$('.type').val(),
                            wx_sub_merchant_id:$('.hltx_wx_sub_merchant_id').val(),
                            weixin_path:$('.hltx_wx_path').val(),
                            qd:$('.qd').val(),
                            pass: pass,
                    path: 'api/user/open_ways_type'
                        },function(res){
                            console.log(res);
                            if(res.status==1){
                                layer.msg(res.message, {
                                    offset: '15px'
                                    ,icon: 1
                                    ,time: 1000
                                },function(){
                                    window.location.reload();
                                });
                            }else{
                                layer.msg(res.message, {
                                    offset: '15px'
                                    ,icon: 2
                                    ,time: 3000
                                });
                            }
                        },"json");

                }else{
                    $.post("{{url('/api/user/open_ways_type')}}",
                        {
                            token:token,
                            store_id:store_id,
                            ways_type:$('.type').val(),
                            MerchantId:$('.hltx_wx_sub_merchant_id').val(),
                            weixin_path:$('.hltx_wx_path').val(),
                            qd:$('.qd').val(),
                            pass: pass,
                    path: 'api/user/open_ways_type'
                        },function(res){
                            console.log(res);
                            if(res.status==1){
                                layer.msg(res.message, {
                                    offset: '15px'
                                    ,icon: 1
                                    ,time: 1000
                                },function(){
                                    window.location.reload();
                                });
                            }else{
                                layer.msg(res.message, {
                                    offset: '15px'
                                    ,icon: 2
                                    ,time: 3000
                                });
                            }
                        },"json");
                }
            }else{
                if($('.type').val() == 2000){
                    $.post("{{url('/api/user/open_ways_type')}}",
                        {
                            token:token,
                            store_id:store_id,
                            ways_type:$('.type').val(),
                            wx_sub_merchant_id:$('.hltx_wx_sub_merchant_id').val(),
                            qd:$('.hltxqd').val(),
                            pass: pass,
                    path: 'api/user/open_ways_type'
                        },function(res){
                            console.log(res);
                            if(res.status==1){
                                layer.msg(res.message, {
                                    offset: '15px'
                                    ,icon: 1
                                    ,time: 1000
                                },function(){
                                    window.location.reload();
                                });
                            }else{
                                layer.msg(res.message, {
                                    offset: '15px'
                                    ,icon: 2
                                    ,time: 3000
                                });
                            }
                        },"json");

                }else{
                    $.post("{{url('/api/user/open_ways_type')}}",
                        {
                            token:token,
                            store_id:store_id,
                            ways_type:$('.type').val(),
                            MerchantId:$('.hltx_wx_sub_merchant_id').val(),
                            qd:$('.hltxqd').val(),
                            pass: pass,
                    path: 'api/user/open_ways_type'
                        },function(res){
                            console.log(res);
                            if(res.status==1){
                                layer.msg(res.message, {
                                    offset: '15px'
                                    ,icon: 1
                                    ,time: 1000
                                },function(){
                                    window.location.reload();
                                });
                            }else{
                                layer.msg(res.message, {
                                    offset: '15px'
                                    ,icon: 2
                                    ,time: 3000
                                });
                            }
                        },"json");
                }
            }

        });

        // 工行商户信息
        $('.lianfuButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.lianfu_sub_merchant_id').val(),
                    Icbc_area:$('.icbc_type').val(),
                    lianfuappid:'',
                    signkey:'',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });
        
        // 农金商户信息
        $('.nongjinButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.nongjin_sub_merchant_id').val(),
                    nongjinkey:$('.nongjinkey1').val(),
                    zhongduanid:$('.zhongduanid1').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });
        
        // 农金商户信息
        $('.gsnongjinButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.gsnongjin_merchant_id').val(),
                    gsnongjin_merchant_id:$('.gsnongjin_merchant_id').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });
        
        
        // 农行bmp商户信息
        $('.abcButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.abc_sub_merchant_id').val(),
                    abckey:$('.abckey').val(),
                    abczhongduanid:$('.abczhongduanid').val(),
                    abcprivate_rsa_key:$('.abcprivate_rsa_key').val(),
                    abcpublic_rsa_key:$('.abcpublic_rsa_key').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });
        
        // 农行静态码商户信息
        $('.abc_quietButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.abc_quiet_merchant_id').val(),
                    abc_quiet_merchant_id:$('.abc_quiet_merchant_id').val(),
                    abc_quiet_cashier_id:$('.abc_quiet_cashier_id').val(),
                    abc_quiet_private_key:$('.abc_quiet_private_key').val(),
                    abc_quiet_public_key:$('.abc_quiet_public_key').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });
        
        // 翼支付商户信息
        $('.wingButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.wing_institutionCode').val(),
                    wing_institutionCode:$('.wing_institutionCode').val(),
                    wing_merchantNo:$('.wing_merchantNo').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });
        
        // 翼支付商户信息
        $('.coolButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.cool_merchantNo').val(),
                    cool_merchantNo:$('.cool_merchantNo').val(),
                    cool_secretkey:$('.cool_secretkey').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });
        
        // 扫呗商户信息
        $('.saobeiButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.saobei_merchantNo').val(),
                    saobei_zhongduan:$('.saobei_zhongduan').val(),
                    saobei_token:$('.saobei_token').val(),
                    saobei_merchantNo:$('.saobei_merchantNo').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });
        
        // 建行商户信息
        $('.ccbButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.ccb_merchantid').val(),
                    ccb_merchantid:$('.ccb_merchantid').val(),
                    ccb_posid:$('.ccb_posid').val(),
                    ccb_bankchid:$('.ccb_bankchid').val(),
                    ccb_pubkey:$('.ccb_pubkey').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });

        // 扫呗商户信息
        $('.allinpayButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.cusid').val(),
                    orgid:$('.orgid').val(),
                    cusid:$('.cusid').val(),
                    allinpay_appid:$('.allinpay_appid').val(),
                    allinpay_pubkey:$('.allinpay_pubkey').val(),
                    allinpay_prikey:$('.allinpay_prikey').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });
        
        // 平安商户信息
        $('.pinganButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.pingan_merchant_id').val(),
                    pingan_merchant_id:$('.pingan_merchant_id').val(),
                    pingan_enterpriseReg:$('.pingan_enterpriseReg').val(),
                    pingan_appid:'jnhg4j89fg7jh94df98hrthytryrtyyy',
                    pingan_appsecret:'dfj4m98gh74j98g4h98k4g84jh98khj4',
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });
        
        // 银联商务商户信息
        $('.merchButton').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    merch_appid:$('#open_passway_unionpay_merch .merch_appid').val(),
                    merch_appkey:$('#open_passway_unionpay_merch .merch_appkey').val(),
                    MerchantId:$('#open_passway_unionpay_merch .merch_sub_merchant_id').val(),
                    merchzhongduanid:$('#open_passway_unionpay_merch .merchzhongduanid').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });

        //银联商户V2信息
        $('.merchV2Button').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    merch_appid:$('#open_passway_unionpay_merch_v2 .merch_appid').val(),
                    merch_appkey:$('#open_passway_unionpay_merch_v2 .merch_appkey').val(),
                    MerchantId:$('#open_passway_unionpay_merch_v2 .merch_sub_merchant_id').val(),
                    merchzhongduanid:$('#open_passway_unionpay_merch_v2 .merchzhongduanid').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });

        // 官方微信添加字段 wx_shop_id
        $('.open_way_weixin').click(function(){
//            console.log($('.ways_source').val());
            if($('.ways_source').val()=='weixin'){
                $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:$('.type').val(),
                        wx_sub_merchant_id:$('.wx_sub_merchant_id_shop').val(),
                        weixin_path:$('.wx_path_shop').val(),
                        wx_shop_id:$('.wx_shop').val(),
                        pass: pass,
                    path: 'api/user/open_ways_type'
                    },function(res){
                        console.log(res);
                        if(res.status==1){
                            layer.msg(res.message, {
                                offset: '15px'
                                ,icon: 1
                                ,time: 1000
                            },function(){
                                window.location.reload();
                            });
                        }else{
                            layer.msg(res.message, {
                                offset: '15px'
                                ,icon: 2
                                ,time: 3000
                            });
                        }
                    },"json");
            }

        });

        //官方微信a 提交分账
        $('.open_way_weixina').click(function(e) {
                //console.log($('.ways_source').val());
                e.preventDefault();

                var wxa_sharing_open = $("#open_passway_weixina input[name=wxa_sharing_open]:checked").val();

                var wxa_sharing_relation_type = $("#open_passway_weixina input[name=wxa_sharing_relation_type]:checked").val();

                var arr = [];
                $.each($('.wxa_sharing_relation_type:checkbox:checked'), function() {
                    arr.push($(this).attr("as"));
                });
                if (arr.length > 0) {
                    var wxa_sharing_relation_type = arr.join(",");
                } else {
                    var wxa_sharing_relation_type = "";
                }

                var request_data = {
                    token: token,
                    store_id: store_id,
                    ways_type: $('.type').val(),
                    //商户号输入框赋值
                    wx_sub_merchant_id: $('.wxa_sub_merchant_id_shop').val(),
                    //微信支付目录
                    weixin_path: $('.wxa_path_shop').val(),
                    //优惠商品ID
                    wx_shop_id: $('.wxa_shop').val(),
                    //开启分账
                    wxSharingOpen: wxa_sharing_open,
                    //分账接收方类型
                    wxSharingType: $('.wxa_sharing_type').val(),
                    //分账接收方帐号
                    wxSharingTccount: $('.wxa_sharing_account').val(),
                    //分账接收方全称
                    wxSharingName: $('.wxa_sharing_name').val(),
                    //与分账方的关系类型
                    wxSharingRelationType: wxa_sharing_relation_type,
                    //设置比例
                    wxSharingRate: $('.wxa_sharing_proportion').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                };

                if ($('.ways_source').val() == 'weixin') {
                    $.post("{{url('/api/user/open_ways_type')}}", request_data, function(res) {
                        //                    console.log(res);
                        if (res.status == 1) {
                            layer.msg(res.message, {
                                offset: '15px',
                                icon: 1,
                                time: 1000
                            }, function() {
                                window.location.reload();
                            });
                        } else {
                            layer.msg(res.message, {
                                offset: '15px',
                                icon: 2,
                                time: 3000
                            });
                        }
                    }, "json");
                }
            });

            $('.wftpay_save').click(function() {
                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: $('.type').val(),
                    wftpayMchId: $('.wftpay_mch_id').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                }, function(res) {
                    if (res.status == 1) {
                        layer.msg(res.message, {
                            offset: '50px',
                            icon: 1,
                            time: 1000
                        }, function() {
                            window.location.reload();
                        });
                    } else {
                        layer.msg(res.message, {
                            offset: '50px',
                            icon: 2,
                            time: 3000
                        });
                    }
                }, "json");
            });
            
            //兴业银行
            $('.cib_save').click(function() {
                $.post("{{url('/api/user/open_ways_type')}}", {
                    token: token,
                    store_id: store_id,
                    ways_type: $('.type').val(),
                    cibpayMchId: $('.cib_mch_id').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                }, function(res) {
                    if (res.status == 1) {
                        layer.msg(res.message, {
                            offset: '50px',
                            icon: 1,
                            time: 1000
                        }, function() {
                            window.location.reload();
                        });
                    } else {
                        layer.msg(res.message, {
                            offset: '50px',
                            icon: 2,
                            time: 3000
                        });
                    }
                }, "json");
            });
            
             //重庆银行
        $('.cqcbank_save').click(function() {
            $.post("{{url('/api/user/open_ways_type')}}", {
                token: token,
                store_id: store_id,
                ways_type: $('.type').val(),
                MerchantId: $('.cqcbank_mch_id').val(),
                pass: pass,
                path: 'api/user/open_ways_type'
            }, function(res) {
                if (res.status == 1) {
                    layer.msg(res.message, {
                        offset: '50px',
                        icon: 1,
                        time: 1000
                    }, function() {
                        window.location.reload();
                    });
                } else {
                    layer.msg(res.message, {
                        offset: '50px',
                        icon: 2,
                        time: 3000
                    });
                }
            }, "json");
        });

        $('.hwcpay_save').click(function() {
            $.post("{{url('/api/user/open_ways_type')}}", {
                token: token,
                store_id: store_id,
                ways_type: $('.type').val(),
                hwcpayMchId: $('.hwcpay_mch_id').val(),
                hwcpayMerchantNum: $('.hwcpay_merchant_num').val(),
                pass: pass,
                    path: 'api/user/open_ways_type'
            }, function(res) {
                if (res.status == 1) {
                    layer.msg(res.message, {
                        offset: '50px',
                        icon: 1,
                        time: 1000
                    }, function() {
                        window.location.reload();
                    });
                } else {
                    layer.msg(res.message, {
                        offset: '50px',
                        icon: 2,
                        time: 3000
                    });
                }
            }, "json");
        });

        $('.yinka_save').click(function() {
            $.post("{{url('/api/user/open_ways_type')}}", {
                token: token,
                store_id: store_id,
                ways_type: $('.type').val(),
                yinka_unique_id: $('.yinka_unique_id').val(),
                yinka_sn: $('.yinka_sn').val(),
                yinka_id: $('.yinka_id').val(),
                yinka_key: $('.yinka_key').val(),
                yinka_pri_key: $('.yinka_pri_key').val(),
                pass: pass,
                path: 'api/user/open_ways_type'
            }, function(res) {
                if (res.status == 1) {
                    layer.msg(res.message, {
                        offset: '50px',
                        icon: 1,
                        time: 1000
                    }, function() {
                        window.location.reload();
                    });
                } else {
                    layer.msg(res.message, {
                        offset: '50px',
                        icon: 2,
                        time: 3000
                    });
                }
            }, "json");
        });

        $('.cmbc_save').click(function() {
            $.post("{{url('/api/user/open_ways_type')}}", {
                token: token,
                store_id: store_id,
                ways_type: $('.type').val(),
                cmbc_mch_id: $('.cmbc_mch_id').val(),
                cmbc_private_key: $('.cmbc_private_key').val(),
                pass: pass,
                path: 'api/user/open_ways_type'
            }, function(res) {
                if (res.status == 1) {
                    layer.msg(res.message, {
                        offset: '50px',
                        icon: 1,
                        time: 1000
                    }, function() {
                        window.location.reload();
                    });
                } else {
                    layer.msg(res.message, {
                        offset: '50px',
                        icon: 2,
                        time: 3000
                    });
                }
            }, "json");
        });

        $('.yinsheng_save').click(function() {
            $.post("{{url('/api/user/open_ways_type')}}", {
                token: token,
                store_id: store_id,
                ways_type: $('.type').val(),
                yinsheng_seller_id: $('.yinsheng_seller_id').val(),
                pass: pass,
                path: 'api/user/open_ways_type'
            }, function(res) {
                if (res.status == 1) {
                    layer.msg(res.message, {
                        offset: '50px',
                        icon: 1,
                        time: 1000
                    }, function() {
                        window.location.reload();
                    });
                } else {
                    layer.msg(res.message, {
                        offset: '50px',
                        icon: 2,
                        time: 3000
                    });
                }
            }, "json");
        });

        $('.save_tf').click(function(){
            if($('.ways_source').val() == "weixin"){
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.tf_merchant_id').val(),
                    weixin_path:$('.wx_path_tf').val(),
                    qd:$('.tfqd').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }else{
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.tf_merchant_id').val(),
                    qd:$('.tfqd').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }
        });

        $('.open_jiesuan').click(function(){
            //loading层
            var index = layer.load(1, {
                shade: [0.1,'#fff'] //0.1透明度的白色背景
            });

            $.post("{{url('/api/basequery/openways')}}",
            {
                token:token,
                store_id:store_id,
                ways_type:$('.type').val(),
                settle_mode_type:$('.js').val(),
                pass: pass,
                path: 'api/user/open_ways_type'
            },function(res){
//                console.log(res);
                layer.close(index);

                if(res.status==1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            },"json");
        });

        $('.open_tf_jiesuan').click(function(){
            //loading层
            var index = layer.load(1, {
                shade: [0.1,'#fff'] //0.1透明度的白色背景
            });

            $.post("{{url('/api/basequery/openways')}}",
            {
                token:token,
                store_id:store_id,
                ways_type:$('.type').val(),
                settle_mode_type:$('.js_open_tf').val(),
                qd:$('.qd').val()
            },function(res){
//                console.log(res);
                layer.close(index);

                if(res.status==1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            },"json");
        });

        $('.open_hltx_jiesuan').click(function(){
            //loading层
            var index = layer.load(1, {
                shade: [0.1,'#fff'] //0.1透明度的白色背景
            });

            $.post("{{url('/api/basequery/openways')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    settle_mode_type:$('.js_open_tf').val(),
                    qd:$('.hltxqd').val()
                },function(res){
                    console.log(res);
                    layer.close(index)

                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });

        $('.open_ways').click(function(){
            if($('.ways_source').val() == 'weixin'){
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    h_mid:$('.wx_sub_hrt').val(),
                    weixin_path:$('.wx_path_hrt').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }else{
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    h_mid:$('.wx_sub_hrt').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }
        });

        $('.open_alipay_store_id').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
            {
                token:token,
                store_id:store_id,
                ways_type:$('.alipaytype').val(),
                alipay_store_id:$('.wx_sub_alipay').val(),
                out_store_id:$('.wx_sub_alipay_wai').val(),
                pass: pass,
                    path: 'api/user/open_ways_type'
            },function(res){
//                console.log(res);
                if(res.status==1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            },"json");
        });

        $('.open_ltf_save').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
            {
                token:token,
                store_id:store_id,
                ways_type:$('.ltf_type').val(),
                merchantCode:$('.ltf1').val(),
                md_key:$('.ltf2').val(),
                appId:$('.ltf3').val(),
                pass: pass,
                    path: 'api/user/open_ways_type'
            },function(res){
//                console.log(res);
                if(res.status==1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            },"json");
        });

        $('.sxf_save').click(function(){
            if($('.ways_source').val() == "weixin"){
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.sxf_input1').val(),
                    wx_channel_appid:$('.sxf_input2').val(),
                    weixin_path:$('.wx_path_sxf').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }else{
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.sxf_input1').val(),
                    wx_channel_appid:$('.sxf_input2').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }
        });

        $('.changsha_save').click(function(){
            console.log($('.ways_source').val())
            if($('.ways_source').val()=='weixin'){
                $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:$('.type').val(),
                        MerchantId:$('.changsha_wx_sub_merchant_id').val(),
                        weixin_path:$('.changsha_wx_path').val(),
                        DeptId:$('.store_num').val(),
                        StaffId:$('.merchant_num').val(),
                        pass: pass,
                    path: 'api/user/open_ways_type'
                    },function(res){
                        console.log(res);
                        if(res.status==1){
                            layer.msg(res.message, {
                                offset: '15px'
                                ,icon: 1
                                ,time: 1000
                            },function(){
                                window.location.reload();
                            });
                        }else{
                            layer.msg(res.message, {
                                offset: '15px'
                                ,icon: 2
                                ,time: 3000
                            });
                        }
                    },"json");

            }else{
                $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:$('.type').val(),
                        MerchantId:$('.changsha_wx_sub_merchant_id').val(),
                        // weixin_path:$('.changsha_wx_path').val(),
                        DeptId:$('.store_num').val(),
                        StaffId:$('.merchant_num').val(),
                        pass: pass,
                    path: 'api/user/open_ways_type'
                    },function(res){
                        console.log(res);
                        if(res.status==1){
                            layer.msg(res.message, {
                                offset: '15px'
                                ,icon: 1
                                ,time: 1000
                            },function(){
                                window.location.reload();
                            });
                        }else{
                            layer.msg(res.message, {
                                offset: '15px'
                                ,icon: 2
                                ,time: 3000
                            });
                        }
                    },"json");
            }

        });

        $('.lianfuyoupay_save').click(function(){
//            console.log($('.ways_source').val());
            if($('.ways_source').val()=='weixin'){
                $.post("{{url('/api/user/open_ways_type')}}",
                    {
                        token:token,
                        store_id:store_id,
                        ways_type:$('.type').val(),
                        MerchantId:$('.lianfuyoupay_merchant_id').val(),
                        weixin_path:$('.lianfuyoupay_wx_path').val(),
                        pos_sn:$('.pos_sn').val(),
                        signkey:$('.lianfuyoupaykey').val(),
                        you_type:$('.you_type').val(),
                        pass: pass,
                    path: 'api/user/open_ways_type'
                    },function(res){
//                        console.log(res);
                        if(res.status==1){
                            layer.msg(res.message, {
                                offset: '15px'
                                ,icon: 1
                                ,time: 1000
                            },function(){
                                window.location.reload();
                            });
                        }else{
                            layer.msg(res.message, {
                                offset: '15px'
                                ,icon: 2
                                ,time: 3000
                            });
                        }
                    },"json");

            }else{
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.type').val(),
                    MerchantId:$('.lianfuyoupay_merchant_id').val(),
                    // weixin_path:$('.lianfuyoupay_wx_path').val(),
                    pos_sn:$('.pos_sn').val(),
                    signkey:$('.lianfuyoupaykey').val(),
                    you_type:$('.you_type').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                        console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '15px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }

        });

        $('.sort').click(function(){
            $(this).attr('lay-href',"{{url('/user/passwaysort?')}}"+store_id);
        });

        $('.open_dlb_save').click(function(){
            if($('ways_source').val() == "weixin"){
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.dlb_type').val(),
                    mch_num:$('.dlb_inputs').eq(0).val(),
                    shop_num:$('.dlb_inputs').eq(1).val(),
                    machine_num:$('.dlb_inputs').eq(2).val(),
                    weixin_path:$('.wx_path_dlb').val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }else{
                $.post("{{url('/api/user/open_ways_type')}}",
                {
                    token:token,
                    store_id:store_id,
                    ways_type:$('.dlb_type').val(),
                    mch_num:$('.dlb_inputs').eq(0).val(),
                    shop_num:$('.dlb_inputs').eq(1).val(),
                    machine_num:$('.dlb_inputs').eq(2).val(),
                    pass: pass,
                    path: 'api/user/open_ways_type'
                },function(res){
//                    console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
            }
        });

        //汇付-绑定机具
        $('.save_huipay').click(function(){
            $.post("{{url('/api/user/hui_pay_bind')}}",
            {
                token:token
                ,store_id:store_id
                ,ways_type:$('.type').val()
                ,device_id:$('.huipay_inputs').val()
            },function(res){
                console.log(res);
                if(res.status==1){
                    layer.msg(res.message, {
                        offset: '15px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '15px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            },"json");
        });

        $('.easypay_save').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
            {
                token:token
                ,store_id:store_id
                ,ways_type:$('.type').val()
                ,easyPayMerCode:$('.easypay_mercode').val()
                ,easyPayTermCode:$('.easypay_termcode').val()
                ,easyPayOperaTrace:$('.easypay_operatrace').val(),
                easyPrivateKey:$('.easypay_private_key').val(),
                pass: pass,
                    path: 'api/user/open_ways_type'
            },function(res){
                if(res.status == 1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            },"json");
        });

        $('.f_box').on('click','.open_f_save',function(){
//            console.log($(this).siblings('.f_block').attr('data'));
//	      console.log($(this).siblings('.f_status').attr('data'));
//            console.log($(this).siblings().find('.f_inputs').val());
            $.post("{{url('/api/alipayopen/set_store_fq_rate')}}",
                {
                    token:token,
                    store_id:store_id,
                    num:$(this).siblings('.f_block').attr('data'),
                    rate:$(this).siblings().find('.f_inputs').val(),
          	    status:$(this).siblings('.f_status').attr('data')
                },function(res){
//                console.log(res);
                    if(res.status==1){
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 1
                            ,time: 1000
                        },function(){
                            window.location.reload();
                        });
                    }else{
                        layer.msg(res.message, {
                            offset: '50px'
                            ,icon: 2
                            ,time: 3000
                        });
                    }
                },"json");
        });

        //返还设置
        $('#edit_flower').on('click','.returnSettings',function(){
            $(this).attr("lay-href","{{url('/user/returnSettings?')}}"+store_id);
//      console.log('0000');
        });

        $('.linkage_save').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}",
            {
                token:token
                ,store_id:store_id
                ,ways_type:$('.type').val()
                ,linkageAcqMerId:$('.linkageAcqMerId').val()
                ,linkageSubAppid:$('.linkageSubAppid').val()
                ,linkageSubMchId:$('.linkageSubMchId').val()
                ,linkageMerId:$('.linkageMerId').val()
                ,weixin_path:$('.linkage_wx_path').val(),
                pass: pass,
                    path: 'api/user/open_ways_type'
            },function(res){
                if(res.status == 1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            },"json");
        });
        
        $('.jiujiang_save').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}", {
                token:token
                ,store_id:store_id
                ,ways_type:$('.type').val()
                ,jiujiang_mchtNo: $('.jiujiang_mchtNo').val()
                ,jiujiang_termNo: $('.jiujiang_termNo').val()
                ,jiujiang_private_key: 'MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJTxquz2Noez8gpQ+PzWp+dDZfHa1zKmionRVLa1/d9Td+Tk1lmzMsQ4FBeQPrbzmLwTai+H2ni7gYxw2bCYy4MJN5RZrwmtOelCAtK3eCCTdxjLDkYJgNpZVQihpGEpydS6k+CXDz8z9zWVo54HwxF/kGuNHzkmQcgdFOXVzr5JAgMBAAECgYBii5bcm3auyIcu/i4PE3MZ1wT/RRy23WuyDbcwAC+NcCtWXXXY+XBwVO4uPPjRkVCPt4S9F/SbhuwK4KuXZTDYaJ+ihkoK7r7dDVlXx9Ryd2mllhuM+WlRnD642baL4EtkqQu/RBbDEjrMrPQO9MAyjaCHXiE+Cdj6yl3dOewBlQJBANw89MpHZy47fUYcHPbAaIYtSTF+qOdgFzDVsw9WSYLhCDa+X71lB2iuvGlx2Ot/Sc3TgatOF6vaGO0YnTQCcKcCQQCtIRkoZtGWRjJuaU9UnZAVSxqZTOenITwJpb6fkyEfcTiZ9aFw3T0bjzt+7XrVk4E855xdmE94G7h+8lOCIMePAkEAzt+TMM6RZSQMMGcH7eAeTqsLLarEDVJ9dinF4Io00vN+O63nUIgtxW8dHA8Mq2kNcoFSNA9OvOZIs62DPO9t0QJAZnYKL5D6RRdyTUnh+0/sr81tBoEvMAhJQeRntoUau0MEnolybBtjSOYx7eKaKcBMYkEol3PGxGyTef3sUj0YHQJBANbi5mtlqXEhTj6pDh0yoUnDJSZHqNuR9kfkbn4rUjzRwfkeqwwv1oNX3PdMm2HPSBCKZmR92EEcZysWJIMS6hc=',
                pass: pass,
                path: 'api/user/open_ways_type',
                MerchantId: $('.jiujiang_mchtNo').val()
            },function(res){
                if(res.status == 1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            },"json");
        });
        $('.dongguan_save').click(function(){
            $.post("{{url('/api/user/open_ways_type')}}", {
                token:token
                ,store_id:store_id
                ,ways_type:$('.type').val()
                ,dongguan_mchtNo: $('.dongguan_mchtNo').val()
                ,dongguan_termNo: $('.dongguan_termNo').val()
                ,dongguan_private_key: $('.dongguan_private_key').val(),
                pass: pass,
                path: 'api/user/open_ways_type',
                MerchantId: $('.dongguan_mchtNo').val()
            },function(res){
                if(res.status == 1){
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 1
                        ,time: 1000
                    },function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '50px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            },"json");
        });

        $('.configure_channel_submit').click(function(obj){
            var model=$(".model").val();
            var channel_radio = $('input:radio:checked').val();
            var company=$(".configure_channel_company").val();
            if(model==1){
                if( channel_radio == 1 ){
                    var data = {
                        "token": token,
                        "store_id": store_id,
                        "model": model,
                        "channel_radio": channel_radio,
                        "configure_channel_company": $(".configure_channel_company").val(),
    
                        "agency_cost1": $(".agency_cost1").val(),
                        "agent_id1": $(".agent_id1").val(),
                        "agency_cost2": $(".agency_cost2").val(),
                        "agent_id2": $(".agent_id2").val(),
                        "agency_cost3": $(".agency_cost3").val(),
                        "agent_id3": $(".agent_id3").val(),
                        "agency_cost4": $(".agency_cost4").val(),
                        "agent_id4": $(".agent_id4").val(),
                        "agency_cost5": $(".agency_cost5").val(),
                        "agent_id5": $(".agent_id5").val(),
                        "agency_cost6": $(".agency_cost6").val(),
                        "agent_id6": $(".agent_id6").val(),
                        "agency_cost7": $(".agency_cost7").val(),
                        "agent_id7": $(".agent_id7").val(),
    
                        "configure_channel_fee": $(".configure_channel_fee_fuwu").val(),
                        pass: pass,
                        path: 'api/user/open_ways_type',
                    };
                }else{
                    var data = {
                        "token": token,
                        "store_id": store_id,
                        "model": $(".model").val(),
                        "channel_radio": $('input:radio:checked').val(),
                        "configure_channel_company": $(".configure_channel_company").val(),
    
                        "agency_cost1": $(".agency_cost1").val(),
                        "agent_id1": $(".agent_id1").val(),
                        "agency_cost2": $(".agency_cost2").val(),
                        "agent_id2": $(".agent_id2").val(),
                        "agency_cost3": $(".agency_cost3").val(),
                        "agent_id3": $(".agent_id3").val(),
                        "agency_cost4": $(".agency_cost4").val(),
                        "agent_id4": $(".agent_id4").val(),
                        "agency_cost5": $(".agency_cost5").val(),
                        "agent_id5": $(".agent_id5").val(),
                        "agency_cost6": $(".agency_cost6").val(),
                        "agent_id6": $(".agent_id6").val(),
                        "agency_cost7": $(".agency_cost7").val(),
                        "agent_id7": $(".agent_id7").val(),
    
                        "configure_channel_zfb": $(".configure_channel_zfb").val(),
                        "configure_channel_weixin": $(".configure_channel_weixin").val(),
                        "configure_channel_cloud": $(".configure_channel_cloud").val(),
                        "configure_channel_debit": $(".configure_channel_debit").val(),
                        "configure_channel_credit": $(".configure_channel_credit").val(),
                        "money_level1": $(".money_level1").val(),
                        "money_level2": $(".money_level2").val(),
                        "money_level3": $(".money_level3").val(),
                        pass: pass,
                        path: 'api/user/open_ways_type',
                    };
                }
            }else if(model==2){
                if( channel_radio == 1 ){
                    var data = {
                        "token": token,
                        "store_id": store_id,
                        "model": model,
                        "channel_radio": channel_radio,
                        "configure_channel_company": company,
    
                        "agency_cost1": $(".agency_cost1").val(),
                        "agent_id1": $(".agent_id1").val(),
                        "agency_cost2": $(".agency_cost2").val(),
                        "agent_id2": $(".agent_id2").val(),
                        "agency_cost3": $(".agency_cost3").val(),
                        "agent_id3": $(".agent_id3").val(),
                        "agency_cost4": $(".agency_cost4").val(),
                        "agent_id4": $(".agent_id4").val(),
                        "agency_cost5": $(".agency_cost5").val(),
                        "agent_id5": $(".agent_id5").val(),
                        "agency_cost6": $(".agency_cost6").val(),
                        "agent_id6": $(".agent_id6").val(),
                        "agency_cost7": $(".agency_cost7").val(),
                        "agent_id7": $(".agent_id7").val(),
    
                        "configure_channel_fee": $(".configure_channel_fee_daikou").val(),
                        pass: pass,
                        path: 'api/user/open_ways_type',
                    };
                }else{
                    var data = {
                        "token": token,
                        "store_id": store_id,
                        "model": $(".model").val(),
                        "channel_radio": $('input:radio:checked').val(),
                        "configure_channel_company": $(".configure_channel_company").val(),
    
                        "agency_cost1": $(".agency_cost1").val(),
                        "agent_id1": $(".agent_id1").val(),
                        "agency_cost2": $(".agency_cost2").val(),
                        "agent_id2": $(".agent_id2").val(),
                        "agency_cost3": $(".agency_cost3").val(),
                        "agent_id3": $(".agent_id3").val(),
                        "agency_cost4": $(".agency_cost4").val(),
                        "agent_id4": $(".agent_id4").val(),
                        "agency_cost5": $(".agency_cost5").val(),
                        "agent_id5": $(".agent_id5").val(),
                        "agency_cost6": $(".agency_cost6").val(),
                        "agent_id6": $(".agent_id6").val(),
                        "agency_cost7": $(".agency_cost7").val(),
                        "agent_id7": $(".agent_id7").val(),
    
                        "configure_channel_zfb": $(".configure_channel_zfb").val(),
                        "configure_channel_weixin": $(".configure_channel_weixin").val(),
                        "configure_channel_cloud": $(".configure_channel_cloud").val(),
                        "configure_channel_debit": $(".configure_channel_debit").val(),
                        "configure_channel_credit": $(".configure_channel_credit").val(),
                        "money_level1": $(".money_level1").val(),
                        "money_level2": $(".money_level2").val(),
                        "money_level3": $(".money_level3").val(),
                        pass: pass,
                        path: 'api/user/open_ways_type',
                    };
                }
            }else if(model==3){
                if( channel_radio == 1 ){
                    var data = {
                        "token": token,
                        "store_id": store_id,
                        "model": model,
                        "channel_radio": channel_radio,
                        "configure_channel_company": company,
    
                        "agency_cost1": $(".agency_cost1").val(),
                        "agent_id1": $(".agent_id1").val(),
                        "agency_cost2": $(".agency_cost2").val(),
                        "agent_id2": $(".agent_id2").val(),
                        "agency_cost3": $(".agency_cost3").val(),
                        "agent_id3": $(".agent_id3").val(),
                        "agency_cost4": $(".agency_cost4").val(),
                        "agent_id4": $(".agent_id4").val(),
                        "agency_cost5": $(".agency_cost5").val(),
                        "agent_id5": $(".agent_id5").val(),
                        "agency_cost6": $(".agency_cost6").val(),
                        "agent_id6": $(".agent_id6").val(),
                        "agency_cost7": $(".agency_cost7").val(),
                        "agent_id7": $(".agent_id7").val(),
    
                        "configure_channel_fee": $(".configure_channel_fee_tongdao").val(),
                        pass: pass,
                        path: 'api/user/open_ways_type',
                    };
                }else{
                    var data = {
                        "token": token,
                        "store_id": store_id,
                        "model": $(".model").val(),
                        "channel_radio": $('input:radio:checked').val(),
                        "configure_channel_company": $(".configure_channel_company").val(),
    
                        "agency_cost1": $(".agency_cost1").val(),
                        "agent_id1": $(".agent_id1").val(),
                        "agency_cost2": $(".agency_cost2").val(),
                        "agent_id2": $(".agent_id2").val(),
                        "agency_cost3": $(".agency_cost3").val(),
                        "agent_id3": $(".agent_id3").val(),
                        "agency_cost4": $(".agency_cost4").val(),
                        "agent_id4": $(".agent_id4").val(),
                        "agency_cost5": $(".agency_cost5").val(),
                        "agent_id5": $(".agent_id5").val(),
                        "agency_cost6": $(".agency_cost6").val(),
                        "agent_id6": $(".agent_id6").val(),
                        "agency_cost7": $(".agency_cost7").val(),
                        "agent_id7": $(".agent_id7").val(),
    
                        "configure_channel_zfb": $(".configure_channel_zfb").val(),
                        "configure_channel_weixin": $(".configure_channel_weixin").val(),
                        "configure_channel_cloud": $(".configure_channel_cloud").val(),
                        "configure_channel_debit": $(".configure_channel_debit").val(),
                        "configure_channel_credit": $(".configure_channel_credit").val(),
                        "money_level1": $(".money_level1").val(),
                        "money_level2": $(".money_level2").val(),
                        "money_level3": $(".money_level3").val(),
                        pass: pass,
                        path: 'api/user/open_ways_type',
                    };
                }
            }
            else if(model==4){
                 if( channel_radio == 1 ){
                    var data = {
                        "token": token,
                        "store_id": store_id,
                        "model": model,
                        "channel_radio": channel_radio,
                        "configure_channel_company": company,
    
                        "agency_cost1": $(".agency_cost1").val(),
                        "agent_id1": $(".agent_id1").val(),
                        "agency_cost2": $(".agency_cost2").val(),
                        "agent_id2": $(".agent_id2").val(),
                        "agency_cost3": $(".agency_cost3").val(),
                        "agent_id3": $(".agent_id3").val(),
                        "agency_cost4": $(".agency_cost4").val(),
                        "agent_id4": $(".agent_id4").val(),
                        "agency_cost5": $(".agency_cost5").val(),
                        "agent_id5": $(".agent_id5").val(),
                        "agency_cost6": $(".agency_cost6").val(),
                        "agent_id6": $(".agent_id6").val(),
                        "agency_cost7": $(".agency_cost7").val(),
                        "agent_id7": $(".agent_id7").val(),
    
                        "configure_channel_fee": $(".configure_channel_fee").val(),
                        "money_level1": $(".money_level1").val(),
                        "money_level2": $(".money_level2").val(),
                        "money_level3": $(".money_level3").val(),
                        pass: pass,
                        path: 'api/user/open_ways_type',
                    };
                }else{
                    var data = {
                        "token": token,
                        "store_id": store_id,
                        "model": $(".model").val(),
                        "channel_radio": $('input:radio:checked').val(),
                        "configure_channel_company": $(".configure_channel_company").val(),
    
                        "agency_cost1": $(".agency_cost1").val(),
                        "agent_id1": $(".agent_id1").val(),
                        "agency_cost2": $(".agency_cost2").val(),
                        "agent_id2": $(".agent_id2").val(),
                        "agency_cost3": $(".agency_cost3").val(),
                        "agent_id3": $(".agent_id3").val(),
                        "agency_cost4": $(".agency_cost4").val(),
                        "agent_id4": $(".agent_id4").val(),
                        "agency_cost5": $(".agency_cost5").val(),
                        "agent_id5": $(".agent_id5").val(),
                        "agency_cost6": $(".agency_cost6").val(),
                        "agent_id6": $(".agent_id6").val(),
                        "agency_cost7": $(".agency_cost7").val(),
                        "agent_id7": $(".agent_id7").val(),
    
                        "configure_channel_zfb": $(".configure_channel_zfb").val(),
                        "configure_channel_weixin": $(".configure_channel_weixin").val(),
                        "configure_channel_cloud": $(".configure_channel_cloud").val(),
                        "configure_channel_debit": $(".configure_channel_debit").val(),
                        "configure_channel_credit": $(".configure_channel_credit").val(),
                        "money_level1": $(".money_level1").val(),
                        "money_level2": $(".money_level2").val(),
                        "money_level3": $(".money_level3").val(),
                        pass: pass,
                        path: 'api/user/open_ways_type',
                    };
                }
            }
            $.post("{{url('/api/glow/configure_channel')}}", data, function(res){
                if(res.status == 1){
                    layer.msg(res.message, {
                        offset: '15px'
                        ,icon: 1
                        ,time: 1000
                    }, function(){
                        window.location.reload();
                    });
                }else{
                    layer.msg(res.message, {
                        offset: '15px'
                        ,icon: 2
                        ,time: 3000
                    });
                }
            }, "json");
        });

    });

    </script>
<script>
layui.use('form', function(){
    var form = layui.form;
    form.on('radio(channel)', function (data){
        // console.log(data.value);
        if(data.value == 1){
            $(".channel1").show();
            $(".channel2").hide();
        }else{
            $(".channel2").show();
            $(".channel1").hide();
        }
    });
});
</script>
</body>
</html>
